@scalar/cli 2.0.0 → 2.0.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.
Files changed (4) hide show
  1. package/README.md +2 -2
  2. package/docs.html +145 -83
  3. package/index.js +412 -216
  4. package/package.json +13 -13
package/index.js CHANGED
@@ -13,7 +13,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
13
13
  throw Error('Dynamic require of "' + x + '" is not supported');
14
14
  });
15
15
  var __commonJS = (cb, mod) => function __require2() {
16
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ try {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ } catch (e) {
19
+ throw mod = 0, e;
20
+ }
17
21
  };
18
22
  var __export = (target, all) => {
19
23
  for (var name2 in all)
@@ -6890,14 +6894,14 @@ var require_parser = __commonJS({
6890
6894
  case "scalar":
6891
6895
  case "single-quoted-scalar":
6892
6896
  case "double-quoted-scalar": {
6893
- const fs22 = this.flowScalar(this.type);
6897
+ const fs21 = this.flowScalar(this.type);
6894
6898
  if (atNextItem || it.value) {
6895
- map2.items.push({ start, key: fs22, sep: [] });
6899
+ map2.items.push({ start, key: fs21, sep: [] });
6896
6900
  this.onKeyLine = true;
6897
6901
  } else if (it.sep) {
6898
- this.stack.push(fs22);
6902
+ this.stack.push(fs21);
6899
6903
  } else {
6900
- Object.assign(it, { key: fs22, sep: [] });
6904
+ Object.assign(it, { key: fs21, sep: [] });
6901
6905
  this.onKeyLine = true;
6902
6906
  }
6903
6907
  return;
@@ -7025,13 +7029,13 @@ var require_parser = __commonJS({
7025
7029
  case "scalar":
7026
7030
  case "single-quoted-scalar":
7027
7031
  case "double-quoted-scalar": {
7028
- const fs22 = this.flowScalar(this.type);
7032
+ const fs21 = this.flowScalar(this.type);
7029
7033
  if (!it || it.value)
7030
- fc.items.push({ start: [], key: fs22, sep: [] });
7034
+ fc.items.push({ start: [], key: fs21, sep: [] });
7031
7035
  else if (it.sep)
7032
- this.stack.push(fs22);
7036
+ this.stack.push(fs21);
7033
7037
  else
7034
- Object.assign(it, { key: fs22, sep: [] });
7038
+ Object.assign(it, { key: fs21, sep: [] });
7035
7039
  return;
7036
7040
  }
7037
7041
  case "flow-map-end":
@@ -11822,7 +11826,7 @@ var require_parse2 = __commonJS({
11822
11826
  var require_gray_matter = __commonJS({
11823
11827
  "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js"(exports2, module2) {
11824
11828
  "use strict";
11825
- var fs22 = __require("fs");
11829
+ var fs21 = __require("fs");
11826
11830
  var sections = require_section_matter();
11827
11831
  var defaults = require_defaults();
11828
11832
  var stringify = require_stringify3();
@@ -11906,7 +11910,7 @@ var require_gray_matter = __commonJS({
11906
11910
  return stringify(file2, data, options2);
11907
11911
  };
11908
11912
  matter2.read = function(filepath, options2) {
11909
- const str2 = fs22.readFileSync(filepath, "utf8");
11913
+ const str2 = fs21.readFileSync(filepath, "utf8");
11910
11914
  const file2 = matter2(str2, options2);
11911
11915
  file2.path = filepath;
11912
11916
  return file2;
@@ -69167,7 +69171,7 @@ import { Command as Command51 } from "commander";
69167
69171
 
69168
69172
  // package.json
69169
69173
  var name = "@scalar/cli";
69170
- var version = "2.0.0";
69174
+ var version = "2.0.1";
69171
69175
  var bin = {
69172
69176
  scalar: "./dist/index.js",
69173
69177
  "scalar-cli": "./dist/index.js"
@@ -86554,42 +86558,6 @@ var identityProviderRecordSchema = entitySchema.extend({
86554
86558
  consumerOnly: external_exports.boolean()
86555
86559
  }).meta({ id: "identity-provider-record" });
86556
86560
 
86557
- // ../../packages/entities/dist/auth/oauth-state.js
86558
- var googleProfileSchema = external_exports.object({
86559
- email: emailSchema,
86560
- name: external_exports.string().min(1),
86561
- picture: external_exports.string().optional(),
86562
- email_verified: external_exports.boolean()
86563
- }).meta({ id: "google-profile" });
86564
- var githubProfileSchema = external_exports.object({
86565
- login: external_exports.string(),
86566
- name: external_exports.string().optional().nullable().default(null),
86567
- email: emailSchema.optional().nullable().default(null),
86568
- avatar_url: external_exports.string().optional().nullable().default(null)
86569
- }).meta({ id: "github-profile" });
86570
- var oauthStateSchema = external_exports.object({
86571
- uid: external_exports.string(),
86572
- redirect: external_exports.string(),
86573
- signupDataUid: external_exports.string().optional(),
86574
- teamInvite: external_exports.string().optional(),
86575
- flow: external_exports.enum(OnboardingFlow).optional()
86576
- }).meta({ id: "oauth-state" });
86577
-
86578
- // ../../packages/entities/dist/auth/personal-token.js
86579
- var personalTokenRecordSchema = external_exports.object({
86580
- uid: external_exports.string(),
86581
- /** User friendly name */
86582
- name: external_exports.string().min(3).max(50),
86583
- /** User friendly description */
86584
- description: external_exports.string().max(200).optional().default(""),
86585
- /** Associate a personal token with a team */
86586
- teamUid: external_exports.string(),
86587
- /** Token expiry time in unix timestamp */
86588
- expiresAt: external_exports.number().int(),
86589
- /** Tracks if a token is blacklisted. Should not be used if token is revoked */
86590
- revoked: external_exports.boolean()
86591
- }).meta({ id: "personal-token-record" });
86592
-
86593
86561
  // ../../packages/entities/dist/registry/schema.js
86594
86562
  var RegistryAsset;
86595
86563
  (function(RegistryAsset3) {
@@ -86628,6 +86596,66 @@ var baseRegistrySchema = entitySchema.extend({
86628
86596
  verifiedContent: external_exports.boolean().optional()
86629
86597
  }).meta({ id: "base-registry" });
86630
86598
 
86599
+ // ../../packages/entities/dist/auth/oauth-state.js
86600
+ var googleProfileSchema = external_exports.object({
86601
+ email: emailSchema,
86602
+ name: external_exports.string().min(1),
86603
+ picture: external_exports.string().optional(),
86604
+ email_verified: external_exports.boolean()
86605
+ }).meta({ id: "google-profile" });
86606
+ var githubProfileSchema = external_exports.object({
86607
+ login: external_exports.string(),
86608
+ name: external_exports.string().optional().nullable().default(null),
86609
+ email: emailSchema.optional().nullable().default(null),
86610
+ avatar_url: external_exports.string().optional().nullable().default(null)
86611
+ }).meta({ id: "github-profile" });
86612
+ var oauthStateSchema = external_exports.object({
86613
+ uid: external_exports.string(),
86614
+ redirect: external_exports.string(),
86615
+ signupDataUid: external_exports.string().optional(),
86616
+ teamInvite: external_exports.string().optional(),
86617
+ flow: external_exports.enum(OnboardingFlow).optional()
86618
+ }).meta({ id: "oauth-state" });
86619
+ var microsoftProfileSchema = external_exports.object({
86620
+ email: emailSchema,
86621
+ name: external_exports.string().optional(),
86622
+ /** Entra tenant id; the consumer tenant means a personal account */
86623
+ tid: external_exports.string(),
86624
+ /**
86625
+ * "Email domain owner verified" optional claim. Entra tenant admins can
86626
+ * put arbitrary emails on their users (nOAuth), so without this claim a
86627
+ * work-account email cannot be trusted for allowlist checks.
86628
+ */
86629
+ xms_edov: external_exports.union([external_exports.boolean(), external_exports.string()]).optional()
86630
+ }).meta({ id: "microsoft-profile" });
86631
+ var hostingOauthResourceSchema = external_exports.enum([...RegistryResourceTypes, "sync-project", "project", "publish"]).meta({ id: "hosting-oauth-resource" });
86632
+ var hostingOauthStateSchema = external_exports.object({
86633
+ uid: nanoidSchema,
86634
+ resource: external_exports.object({
86635
+ uid: nanoidSchema,
86636
+ type: hostingOauthResourceSchema
86637
+ }),
86638
+ teamUid: nanoidSchema,
86639
+ redirect: external_exports.string().optional(),
86640
+ /** Stamped on the stored record so abandoned states can be vacuumed */
86641
+ createdAt: external_exports.number().optional()
86642
+ }).meta({ id: "hosting-oauth-state" });
86643
+
86644
+ // ../../packages/entities/dist/auth/personal-token.js
86645
+ var personalTokenRecordSchema = external_exports.object({
86646
+ uid: external_exports.string(),
86647
+ /** User friendly name */
86648
+ name: external_exports.string().min(3).max(50),
86649
+ /** User friendly description */
86650
+ description: external_exports.string().max(200).optional().default(""),
86651
+ /** Associate a personal token with a team */
86652
+ teamUid: external_exports.string(),
86653
+ /** Token expiry time in unix timestamp */
86654
+ expiresAt: external_exports.number().int(),
86655
+ /** Tracks if a token is blacklisted. Should not be used if token is revoked */
86656
+ revoked: external_exports.boolean()
86657
+ }).meta({ id: "personal-token-record" });
86658
+
86631
86659
  // ../../packages/entities/dist/auth/saml-state.js
86632
86660
  var samlStateSchema = external_exports.object({
86633
86661
  uid: nanoidSchema,
@@ -86689,7 +86717,11 @@ var typesenseConfigSchema = external_exports.object({
86689
86717
  var subpathSchema = external_exports.object({
86690
86718
  subpath: external_exports.string(),
86691
86719
  projectUid: external_exports.string(),
86692
- typesenseConfig: typesenseConfigSchema
86720
+ /**
86721
+ * Present only for sites still served by Typesense. Builds on the jsonl
86722
+ * search backend omit it; federated search fetches `${subpath}/search-entries.jsonl`.
86723
+ */
86724
+ typesenseConfig: typesenseConfigSchema.optional().nullable()
86693
86725
  }).meta({ id: "subpath" });
86694
86726
  var siteDeploySchema = entitySchema.extend({
86695
86727
  domain: external_exports.string(),
@@ -86863,6 +86895,8 @@ var agentTokenPayloadSchema = zod_default.object({
86863
86895
  uid: zod_default.string(),
86864
86896
  teamUid: nanoidSchema.optional(),
86865
86897
  documentUids: nanoidSchema.array().optional(),
86898
+ /** Ephemeral key minted for a registry API reference preview page. */
86899
+ registryPreview: zod_default.boolean().optional(),
86866
86900
  exp: zod_default.number().int()
86867
86901
  }).meta({ id: "agent-token-payload" });
86868
86902
 
@@ -86978,14 +87012,24 @@ var mcpInstallationSchema = external_exports.object({
86978
87012
  var monthlyUsageSchema = zod_default.object({
86979
87013
  identifier: zod_default.string(),
86980
87014
  month: zod_default.date(),
86981
- type: zod_default.enum(["public-user", "web-team-user", "agent-key", "docs-project"]),
87015
+ type: zod_default.enum([
87016
+ "public-user",
87017
+ "web-team-user",
87018
+ "agent-key",
87019
+ "docs-project",
87020
+ "mcp-installation",
87021
+ "registry-preview"
87022
+ ]),
86982
87023
  teamUid: zod_default.string().nullable(),
86983
87024
  inputTokens: zod_default.number(),
86984
87025
  outputTokens: zod_default.number(),
86985
- messages: zod_default.number()
87026
+ messages: zod_default.number(),
87027
+ toolCalls: zod_default.number(),
87028
+ // bigint column: the pg driver returns int8 as a string, so coerce on read.
87029
+ microCredits: zod_default.coerce.number()
86986
87030
  }).meta({ id: "monthly-usage" });
86987
87031
 
86988
- // ../../node_modules/.pnpm/@scalar+helpers@0.8.2/node_modules/@scalar/helpers/dist/http/http-methods.js
87032
+ // ../../node_modules/.pnpm/@scalar+helpers@0.9.0/node_modules/@scalar/helpers/dist/http/http-methods.js
86989
87033
  var HTTP_METHODS = ["delete", "get", "head", "options", "patch", "post", "put", "trace"];
86990
87034
  var httpMethods = Object.freeze(new Set(HTTP_METHODS));
86991
87035
 
@@ -87772,6 +87816,7 @@ var publishRecordSchema = entitySchema.extend({
87772
87816
  commitSha: external_exports.string().nullable().default(null),
87773
87817
  version: external_exports.enum(ConfigVersion).default(ConfigVersion.V1),
87774
87818
  isWysiwyg: external_exports.boolean().default(false),
87819
+ unifiedDocs: external_exports.boolean().default(false),
87775
87820
  subpath: external_exports.string().nullable().default(null),
87776
87821
  configPath: external_exports.string().optional().default("scalar.config.json"),
87777
87822
  registryApis: external_exports.object({
@@ -87846,7 +87891,7 @@ var SdkLanguageExperimental = {
87846
87891
  [SdkLanguage.Java]: true,
87847
87892
  [SdkLanguage.Ruby]: true,
87848
87893
  [SdkLanguage.Php]: true,
87849
- [SdkLanguage.Go]: true,
87894
+ [SdkLanguage.Go]: false,
87850
87895
  [SdkLanguage.Rust]: true,
87851
87896
  [SdkLanguage.Kotlin]: true,
87852
87897
  [SdkLanguage.Swift]: true,
@@ -87869,10 +87914,46 @@ var sdkTargetDestinationSchema = external_exports.object({
87869
87914
  prComments: external_exports.boolean().default(false),
87870
87915
  expired: external_exports.boolean().default(false)
87871
87916
  }).meta({ id: "sdk-target-destination" });
87917
+ var sdkSampleRepoSchema = external_exports.object({
87918
+ provider: external_exports.literal("github").default("github"),
87919
+ /**
87920
+ * 'pending' from SDK creation until the repo is provisioned in scalar-sdks;
87921
+ * 'ready' once it exists (name/installationId are filled in then). The
87922
+ * pending state lets the dashboard show the section immediately. Defaults to
87923
+ * 'ready' so pre-existing bindings (which always have a repo) read correctly.
87924
+ */
87925
+ status: external_exports.enum(["pending", "ready"]).default("ready"),
87926
+ /** "scalar-sdks/<repo>" (present once ready). */
87927
+ name: external_exports.string().optional(),
87928
+ /** scalar-sdks installation that grants push access for the bot (once ready). */
87929
+ installationId: external_exports.number().int().optional(),
87930
+ baseBranch: external_exports.string().min(1).default("main"),
87931
+ /** GitHub invitation accept URL, surfaced in the dashboard. Null once the
87932
+ * invite has been re-issued for an already-accepted user (no link to show). */
87933
+ invitationUrl: external_exports.string().nullable().optional(),
87934
+ /** Last build whose artifact was pushed to the playground. */
87935
+ lastSyncedBuild: nanoidSchema.optional()
87936
+ }).meta({ id: "sdk-sample-repo" });
87872
87937
  var sdkTargetSchema = external_exports.object({
87873
87938
  language: external_exports.enum(SdkLanguage),
87874
87939
  slug: slugSchema,
87875
- destination: sdkTargetDestinationSchema.nullable().default(null)
87940
+ destination: sdkTargetDestinationSchema.nullable().default(null),
87941
+ /**
87942
+ * Preview repo in scalar-sdks for this target. Independent of `destination`:
87943
+ * it always mirrors the latest build so users can play with the output before
87944
+ * setting up a production repo.
87945
+ */
87946
+ sample: sdkSampleRepoSchema.nullable().default(null),
87947
+ /**
87948
+ * Build whose generated artifact is the current replay merge base (the last
87949
+ * generated output reconciled into the repo). Lives on the persistent target
87950
+ * rather than a version because the merge base is a property of the
87951
+ * destination. Advanced only on a clean reconcile, so a stuck conflict keeps
87952
+ * replaying against the same base. Absent means first-run overlay.
87953
+ */
87954
+ lastSyncedBuild: nanoidSchema.optional(),
87955
+ /** Rolling branch this target's replay pushes to (defaults per slug). */
87956
+ integrationBranch: external_exports.string().optional()
87876
87957
  }).meta({ id: "sdk-target" });
87877
87958
  var sdkVersionTargetStateSchema = external_exports.object({
87878
87959
  activeSync: external_exports.object({
@@ -87880,6 +87961,22 @@ var sdkVersionTargetStateSchema = external_exports.object({
87880
87961
  pullRequest: external_exports.number(),
87881
87962
  commitHash: external_exports.string()
87882
87963
  }).optional(),
87964
+ /**
87965
+ * Set when the last replay collided: the build awaiting conflict resolution
87966
+ * (resolved through the dashboard resolver, which produces clean code).
87967
+ * Cleared on a clean reconcile.
87968
+ */
87969
+ conflict: external_exports.object({
87970
+ build: nanoidSchema,
87971
+ /**
87972
+ * The conflict PR opened on scratch branches for native (GitHub/editor)
87973
+ * resolution. The merge webhook keys off this to find the target.
87974
+ * Absent for conflicts resolved only through the dashboard resolver.
87975
+ */
87976
+ pullRequest: external_exports.number().optional(),
87977
+ /** Scratch branch holding the resolved tree once that PR is merged. */
87978
+ resolvedBranch: external_exports.string().optional()
87979
+ }).optional(),
87883
87980
  activeBuild: nanoidSchema.optional()
87884
87981
  }).meta({ id: "sdk-version-target-state" });
87885
87982
  var sdkVersionStatusSchema = external_exports.enum(["draft", "published"]);
@@ -87928,7 +88025,7 @@ var sdkSchema = baseRegistrySchema.extend({
87928
88025
  config: external_exports.string().optional()
87929
88026
  }).meta({ id: "sdk" });
87930
88027
  var sdkBuildStatusSchema = external_exports.enum(["pending", "error", "generated"]).meta({ id: "sdk-build-status" });
87931
- var sdkGitStatusSchema = external_exports.enum(["pending", "error", "synced"]).meta({ id: "sdk-git-status" });
88028
+ var sdkGitStatusSchema = external_exports.enum(["pending", "error", "synced", "conflicts"]).meta({ id: "sdk-git-status" });
87932
88029
  var sdkBuildApiSchema = external_exports.object({
87933
88030
  uid: nanoidSchema,
87934
88031
  namespace: namespaceSchema,
@@ -87953,12 +88050,13 @@ var sdkBuildTargetSchema = external_exports.object({
87953
88050
  slug: slugSchema,
87954
88051
  /** Build status */
87955
88052
  buildStatus: sdkBuildStatusSchema,
87956
- /** Additional build message */
87957
- buildMessage: external_exports.string().optional(),
88053
+ /** Additional build message. Nullable: mongobase round-trips an unset
88054
+ * optional as null, and a strict string parse would drop the doc on read. */
88055
+ buildMessage: external_exports.string().nullable().optional(),
87958
88056
  /** Git sync status */
87959
88057
  gitStatus: sdkGitStatusSchema.optional(),
87960
- /** Additional git message */
87961
- gitMessage: external_exports.string().optional(),
88058
+ /** Additional git message. Nullable for the same round-trip reason as buildMessage. */
88059
+ gitMessage: external_exports.string().nullable().optional(),
87962
88060
  /** Linked git repository name */
87963
88061
  repository: external_exports.string().nullable().optional(),
87964
88062
  /** Git sync commit and PR */
@@ -88027,6 +88125,20 @@ var sdkLanguageToScalarTarget = {
88027
88125
  [SdkLanguage.Dart]: "dart",
88028
88126
  [SdkLanguage.Cli]: "cli"
88029
88127
  };
88128
+ var sdkLanguageToRegistry = {
88129
+ [SdkLanguage.Typescript]: "npm",
88130
+ [SdkLanguage.Python]: "pypi",
88131
+ [SdkLanguage.Go]: "go",
88132
+ [SdkLanguage.Rust]: "cargo",
88133
+ [SdkLanguage.Java]: "maven",
88134
+ [SdkLanguage.Kotlin]: "maven",
88135
+ [SdkLanguage.Ruby]: "rubygems",
88136
+ [SdkLanguage.Php]: "packagist",
88137
+ [SdkLanguage.CSharp]: "nuget",
88138
+ [SdkLanguage.Swift]: "swiftpm",
88139
+ [SdkLanguage.Dart]: "pub",
88140
+ [SdkLanguage.Cli]: "homebrew"
88141
+ };
88030
88142
  var scalarTargetDestinationsSchema = external_exports.object({
88031
88143
  production: external_exports.object({
88032
88144
  repo: external_exports.string(),
@@ -88036,7 +88148,10 @@ var scalarTargetDestinationsSchema = external_exports.object({
88036
88148
  var scalarTargetEntrySchema = external_exports.looseObject({
88037
88149
  packageName: external_exports.string().optional(),
88038
88150
  version: external_exports.string().optional(),
88039
- destinations: scalarTargetDestinationsSchema.optional()
88151
+ destinations: scalarTargetDestinationsSchema.optional(),
88152
+ // Per-registry publish config (e.g. `{ npm: { authMethod: 'oidc' } }`). Present only when the
88153
+ // target opts into publish-on-merge; the generator reads it to emit publish workflow steps.
88154
+ publish: external_exports.record(external_exports.string(), external_exports.any()).optional()
88040
88155
  }).meta({ id: "scalar-target-entry" });
88041
88156
  var scalarClientSettingsSchema = external_exports.looseObject({
88042
88157
  opts: external_exports.record(external_exports.string(), external_exports.any()).optional(),
@@ -88067,14 +88182,28 @@ var ExternalAccessMethod;
88067
88182
  (function(ExternalAccessMethod2) {
88068
88183
  ExternalAccessMethod2["Email"] = "email";
88069
88184
  ExternalAccessMethod2["SSO"] = "sso";
88185
+ ExternalAccessMethod2["Google"] = "google";
88186
+ ExternalAccessMethod2["Microsoft"] = "microsoft";
88070
88187
  })(ExternalAccessMethod || (ExternalAccessMethod = {}));
88188
+ var emailInheritingExternalAccessMethods = [
88189
+ ExternalAccessMethod.Google
88190
+ ];
88191
+ var externalAccessMethodByProvider = {
88192
+ google: ExternalAccessMethod.Google,
88193
+ microsoft: ExternalAccessMethod.Microsoft
88194
+ };
88071
88195
  var externalAccessMethodsSchema = external_exports.object({
88072
88196
  [ExternalAccessMethod.Email]: external_exports.boolean().default(true),
88073
- [ExternalAccessMethod.SSO]: external_exports.boolean().default(false)
88197
+ [ExternalAccessMethod.SSO]: external_exports.boolean().default(false),
88198
+ /** No default: an unset social method inherits the email setting */
88199
+ [ExternalAccessMethod.Google]: external_exports.boolean().optional(),
88200
+ [ExternalAccessMethod.Microsoft]: external_exports.boolean().optional()
88074
88201
  }).meta({ id: "external-access-methods" });
88075
88202
  var externalAccessMethodLabels = {
88076
88203
  [ExternalAccessMethod.Email]: "Email Magic Link",
88077
- [ExternalAccessMethod.SSO]: "Single Sign-On"
88204
+ [ExternalAccessMethod.SSO]: "Single Sign-On",
88205
+ [ExternalAccessMethod.Google]: "Google OAuth",
88206
+ [ExternalAccessMethod.Microsoft]: "Microsoft OAuth"
88078
88207
  };
88079
88208
  var externalAccessSchema = external_exports.object({
88080
88209
  /** Available authentication methods for external access */
@@ -88098,6 +88227,7 @@ var FeatureFlag;
88098
88227
  FeatureFlag2["UnifiedDocs"] = "unifiedDocs";
88099
88228
  FeatureFlag2["DocsAnalytics"] = "docsAnalytics";
88100
88229
  FeatureFlag2["McpAnalytics"] = "mcpAnalytics";
88230
+ FeatureFlag2["MicrosoftLogin"] = "microsoftLogin";
88101
88231
  })(FeatureFlag || (FeatureFlag = {}));
88102
88232
  var featureSchema = external_exports.boolean().optional().meta({ id: "feature" });
88103
88233
  var featureFlagSchema = external_exports.object({
@@ -88114,7 +88244,8 @@ var featureFlagSchema = external_exports.object({
88114
88244
  [FeatureFlag.DisableApiSSR]: featureSchema,
88115
88245
  [FeatureFlag.UnifiedDocs]: featureSchema,
88116
88246
  [FeatureFlag.DocsAnalytics]: featureSchema,
88117
- [FeatureFlag.McpAnalytics]: featureSchema
88247
+ [FeatureFlag.McpAnalytics]: featureSchema,
88248
+ [FeatureFlag.MicrosoftLogin]: featureSchema
88118
88249
  }).meta({ id: "feature-flag" });
88119
88250
 
88120
88251
  // ../../packages/entities/dist/team/schema.js
@@ -88172,7 +88303,8 @@ var billingInfoSchema = external_exports.preprocess((arg) => {
88172
88303
  email: emailSchema,
88173
88304
  plan: billingPlanSchema,
88174
88305
  expires: external_exports.number().optional(),
88175
- sdkTrialReminderSentAt: external_exports.number().optional()
88306
+ sdkTrialReminderSentAt: external_exports.number().optional(),
88307
+ includedCreditsOverride: external_exports.number().optional()
88176
88308
  })).meta({ id: "billing-info" });
88177
88309
  var invoiceStatusSchema = external_exports.enum(["open", "paid", "draft", "void", "uncollectible"]).meta({ id: "invoice-status" });
88178
88310
  var billingInvoiceSchema = external_exports.object({
@@ -88399,13 +88531,30 @@ var exchangeTokenSchema = external_exports.object({
88399
88531
  expiry: external_exports.number(),
88400
88532
  teamUid: external_exports.string()
88401
88533
  }).meta({ id: "exchange-token" });
88534
+ var socialOauthProviderSchema = external_exports.enum(["google", "microsoft"]).meta({ id: "social-oauth-provider" });
88402
88535
  var hostingExchangeTokenSchema = external_exports.object({
88403
88536
  email: emailSchema,
88404
88537
  aud: external_exports.url(),
88405
- idp: nanoidSchema,
88538
+ /** Identity provider uid, present when minted from a SAML assertion */
88539
+ idp: nanoidSchema.optional(),
88540
+ /**
88541
+ * The social provider that authenticated the email, present only for
88542
+ * OAuth logins. Absent means SAML, where the team's IdP is the authority.
88543
+ * OAuth proves email ownership only, so the consumer must re-check the
88544
+ * resource's email allowlists and that this provider is enabled before
88545
+ * creating a session.
88546
+ */
88547
+ provider: socialOauthProviderSchema.optional(),
88406
88548
  teamUid: nanoidSchema,
88407
88549
  exp: external_exports.number()
88408
88550
  }).meta({ id: "hosting-exchange-token" });
88551
+ var hostingLoginTokenSchema = entitySchema.extend({
88552
+ email: emailSchema,
88553
+ host: external_exports.string(),
88554
+ redirect: external_exports.string().optional(),
88555
+ loginPortalUid: external_exports.string().optional(),
88556
+ exp: timestampSchema
88557
+ }).meta({ id: "hosting-login-token" });
88409
88558
  var docsAgentTokenSchema = external_exports.object({
88410
88559
  uid: external_exports.string(),
88411
88560
  publishUid: external_exports.string(),
@@ -88680,6 +88829,8 @@ var BaseCollections = {
88680
88829
  SignupMeta: "signup-meta",
88681
88830
  ExchangeTokens: "exchange-tokens",
88682
88831
  HostingExchange: "hosting-exchange",
88832
+ HostingLoginTokens: "hosting-login-tokens",
88833
+ HostingOauthStates: "hosting-oauth-states",
88683
88834
  Passwords: "passwords",
88684
88835
  SignupOtp: "signup-otp",
88685
88836
  GithubUsers: "github-users",
@@ -89582,6 +89733,18 @@ function sdksApiFactory(requestService) {
89582
89733
  schema: external_exports.null()
89583
89734
  });
89584
89735
  }
89736
+ async function requestSampleAccess(data) {
89737
+ return await requestService.request({
89738
+ url: `core/v1/sdks/${data.uid}/sample/access`,
89739
+ method: "post",
89740
+ schema: external_exports.object({
89741
+ repositories: external_exports.object({
89742
+ repository: external_exports.string(),
89743
+ invitationUrl: external_exports.string().nullable()
89744
+ }).array()
89745
+ })
89746
+ });
89747
+ }
89585
89748
  async function updateRepo(data) {
89586
89749
  return await requestService.request({
89587
89750
  url: "core/v1/sdks/repository/update",
@@ -89598,6 +89761,14 @@ function sdksApiFactory(requestService) {
89598
89761
  schema: external_exports.null()
89599
89762
  });
89600
89763
  }
89764
+ async function updatePublishing(data) {
89765
+ return await requestService.request({
89766
+ url: "core/v1/sdks/repository/publishing",
89767
+ method: "post",
89768
+ data,
89769
+ schema: external_exports.null()
89770
+ });
89771
+ }
89601
89772
  async function syncBuild(data) {
89602
89773
  return await requestService.request({
89603
89774
  url: "core/v1/sdks/sync",
@@ -89614,6 +89785,33 @@ function sdksApiFactory(requestService) {
89614
89785
  schema: external_exports.null()
89615
89786
  });
89616
89787
  }
89788
+ async function getConflicts(data) {
89789
+ return await requestService.request({
89790
+ url: "core/v1/sdks/conflicts",
89791
+ method: "post",
89792
+ data,
89793
+ schema: external_exports.object({
89794
+ baseSha: external_exports.string(),
89795
+ files: external_exports.object({
89796
+ filepath: external_exports.string(),
89797
+ ours: external_exports.string(),
89798
+ base: external_exports.string(),
89799
+ theirs: external_exports.string()
89800
+ }).array()
89801
+ })
89802
+ });
89803
+ }
89804
+ async function resolveConflicts(data) {
89805
+ return await requestService.request({
89806
+ url: "core/v1/sdks/conflicts/resolve",
89807
+ method: "post",
89808
+ data,
89809
+ schema: external_exports.object({
89810
+ pullRequest: external_exports.number(),
89811
+ commitHash: external_exports.string()
89812
+ })
89813
+ });
89814
+ }
89617
89815
  return {
89618
89816
  create,
89619
89817
  fromConfig,
@@ -89628,10 +89826,14 @@ function sdksApiFactory(requestService) {
89628
89826
  addAccessGroup,
89629
89827
  removeAccessGroup,
89630
89828
  linkRepo,
89829
+ requestSampleAccess,
89631
89830
  unlinkRepo,
89632
89831
  updateRepo,
89832
+ updatePublishing,
89633
89833
  build,
89634
- syncBuild
89834
+ syncBuild,
89835
+ getConflicts,
89836
+ resolveConflicts
89635
89837
  };
89636
89838
  }
89637
89839
 
@@ -91288,7 +91490,7 @@ var config2 = {
91288
91490
  }
91289
91491
  },
91290
91492
  cdnUrl: process.env.CDN_URL ?? "https://cdn.scalar.com",
91291
- ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.4.5"
91493
+ ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.4.6"
91292
91494
  };
91293
91495
 
91294
91496
  // src/domains/auth/login/helpers/personal-token-generate-access.ts
@@ -92277,7 +92479,7 @@ var DEFAULT_FETCH_CONCURRENCY = 5;
92277
92479
  function BundleCommand() {
92278
92480
  const cmd2 = new Command4("bundle");
92279
92481
  cmd2.description(
92280
- "Bundle an OpenAPI specification by resolving all references and external dependencies"
92482
+ "Bundle an OpenAPI document by resolving all references and external dependencies"
92281
92483
  );
92282
92484
  cmd2.argument("[file|url]", "Path to OpenAPI file or URL to bundle");
92283
92485
  cmd2.option("-o, --output <file>", "Path to save the bundled output file");
@@ -93557,7 +93759,7 @@ function MockCommand() {
93557
93759
  let server;
93558
93760
  const result = await loadOpenApiFile(fileArgument);
93559
93761
  if (!result.valid) {
93560
- return output.error().title("Invalid OpenAPI specification").exit("error");
93762
+ return output.error().title("Invalid OpenAPI document").exit("error");
93561
93763
  }
93562
93764
  printSpecificationBanner({
93563
93765
  version: result.version,
@@ -94013,12 +94215,12 @@ import { Command as Command38 } from "commander";
94013
94215
 
94014
94216
  // src/domains/project/preview/index.ts
94015
94217
  import { text as text4 } from "@clack/prompts";
94016
- import as27 from "ansis";
94218
+ import as28 from "ansis";
94017
94219
  import { Command as Command33 } from "commander";
94018
94220
 
94019
94221
  // src/domains/project/check-config/index.ts
94020
94222
  import fs13 from "node:fs";
94021
- import as25 from "ansis";
94223
+ import as26 from "ansis";
94022
94224
  import { Command as Command31 } from "commander";
94023
94225
 
94024
94226
  // ../../packages/helpers/dist/parse/parse.js
@@ -94052,10 +94254,11 @@ function parseAnything(val, schema) {
94052
94254
  error: "Document does not match the schema",
94053
94255
  issues: result.error.issues
94054
94256
  };
94055
- } catch {
94257
+ } catch (error48) {
94258
+ const detail = error48 instanceof Error ? error48.message : String(error48);
94056
94259
  return {
94057
94260
  success: false,
94058
- error: `Could not parse a valid ${docType} document`,
94261
+ error: `Could not parse a valid ${docType} document: ${detail}`,
94059
94262
  data: null
94060
94263
  };
94061
94264
  }
@@ -94882,11 +95085,20 @@ function parseConfig(rawConfig) {
94882
95085
  try {
94883
95086
  const jsonConfigResult = parseAnything(rawConfig, zod_default.record(zod_default.string(), zod_default.unknown()));
94884
95087
  if (!jsonConfigResult.success)
94885
- return { success: false, error: jsonConfigResult.error };
95088
+ return {
95089
+ success: false,
95090
+ errorType: "parse",
95091
+ error: jsonConfigResult.error
95092
+ };
94886
95093
  const version3 = getConfigVersion(jsonConfigResult.data);
94887
95094
  const { success: success2, data: config3, error: error48 } = configVersionToSchemaMapping[version3].safeParse(jsonConfigResult.data);
94888
95095
  if (!success2) {
94889
- return { success: false, error: error48, version: version3 };
95096
+ return {
95097
+ success: false,
95098
+ errorType: "validation",
95099
+ error: error48,
95100
+ version: version3
95101
+ };
94890
95102
  }
94891
95103
  return {
94892
95104
  success: true,
@@ -94896,7 +95108,7 @@ function parseConfig(rawConfig) {
94896
95108
  }
94897
95109
  };
94898
95110
  } catch (error48) {
94899
- return { success: false, error: error48 };
95111
+ return { success: false, errorType: "parse", error: error48 };
94900
95112
  }
94901
95113
  }
94902
95114
 
@@ -95624,6 +95836,46 @@ function searchInDirectory(directory) {
95624
95836
  }
95625
95837
  }
95626
95838
 
95839
+ // src/domains/project/render-config-error.ts
95840
+ import as25 from "ansis";
95841
+ function renderConfigError(error48) {
95842
+ if (error48.type === "file-not-found") {
95843
+ return output.error().title("Scalar Configuration file not found").message(error48.inputPath).line(
95844
+ as25.grey(
95845
+ "Create a `scalar.config.json`, or pass the path to your configuration file as an argument."
95846
+ )
95847
+ ).exit("error");
95848
+ }
95849
+ if (error48.type === "parse-error") {
95850
+ const block2 = output.error().title("Invalid configuration file").message("Could not parse the Scalar Configuration file:").line(error48.filePath);
95851
+ if (error48.detail) {
95852
+ block2.message(error48.detail);
95853
+ }
95854
+ return block2.exit("error");
95855
+ }
95856
+ const block = output.error().title("The given Scalar Configuration is invalid").message(error48.filePath);
95857
+ const note = versionNote(error48.version);
95858
+ if (note) {
95859
+ block.line(note);
95860
+ }
95861
+ block.line("");
95862
+ for (const line of error48.prettyError.split("\n")) {
95863
+ block.line(line);
95864
+ }
95865
+ return block.exit("error");
95866
+ }
95867
+ function versionNote(version3) {
95868
+ if (version3 === ConfigVersion.V2) {
95869
+ return as25.grey("Validated as Scalar Configuration v2.0.0.");
95870
+ }
95871
+ if (version3 === ConfigVersion.V1) {
95872
+ return as25.grey(
95873
+ 'Validated as a legacy (V1) configuration. If this should be a v2 config, add a top-level `scalar: "2.0.0"` field.'
95874
+ );
95875
+ }
95876
+ return "";
95877
+ }
95878
+
95627
95879
  // src/domains/project/check-config/index.ts
95628
95880
  function readAndParseConfig(configPath) {
95629
95881
  const startTime = performance.now();
@@ -95641,12 +95893,25 @@ function readAndParseConfig(configPath) {
95641
95893
  const fileContent = fs13.readFileSync(file2, "utf-8");
95642
95894
  const parseConfigResult = parseConfig(fileContent);
95643
95895
  if (!parseConfigResult.success) {
95896
+ if (parseConfigResult.errorType === "validation") {
95897
+ return {
95898
+ success: false,
95899
+ error: {
95900
+ type: "validation-error",
95901
+ message: "The given Scalar Configuration is invalid",
95902
+ filePath: file2,
95903
+ prettyError: external_exports.prettifyError(parseConfigResult.error),
95904
+ version: parseConfigResult.version
95905
+ }
95906
+ };
95907
+ }
95644
95908
  return {
95645
95909
  success: false,
95646
95910
  error: {
95647
95911
  type: "parse-error",
95648
95912
  message: "Could not parse the Scalar Configuration file",
95649
- filePath: file2
95913
+ filePath: file2,
95914
+ detail: typeof parseConfigResult.error === "string" ? parseConfigResult.error : parseConfigResult.error instanceof Error ? parseConfigResult.error.message : void 0
95650
95915
  }
95651
95916
  };
95652
95917
  }
@@ -95665,34 +95930,15 @@ function CheckConfigCommand() {
95665
95930
  const result = readAndParseConfig(inputArgument);
95666
95931
  if (result.success) {
95667
95932
  output.info().line(
95668
- `${as25.green("[SUCCESS]")} ${as25.green("The Scalar Configuration is valid:")} ${as25.green(result.filePath)}`
95933
+ `${as26.green("[SUCCESS]")} ${as26.green("The Scalar Configuration is valid:")} ${as26.green(result.filePath)}`
95669
95934
  ).line(
95670
- `${as25.green("Scalar Configuration validated")} ${as25.grey(
95671
- `in ${as25.white.bold(`${result.validationTime} ms`)}`
95935
+ `${as26.green("Scalar Configuration validated")} ${as26.grey(
95936
+ `in ${as26.white.bold(`${result.validationTime} ms`)}`
95672
95937
  )}
95673
95938
  `
95674
95939
  ).print();
95675
95940
  } else {
95676
- const error48 = result.error;
95677
- if (error48.type === "file-not-found") {
95678
- return output.error().title("Invalid configuration file").message("Could not find the Scalar Configuration file:").message(error48.inputPath).exit("error");
95679
- }
95680
- if (error48.type === "parse-error") {
95681
- return output.error().title("Invalid configuration file").line("Could not parse the Scalar Configuration file:").message(error48.filePath).exit("error");
95682
- }
95683
- if (error48.type === "validation-error") {
95684
- output.error().title("The given Scalar Configuration is invalid.").message(error48.filePath).print();
95685
- if (error48.issues) {
95686
- output.error().table(
95687
- error48.issues.map((issue2) => [
95688
- as25.yellow(`${issue2.path.join("/").trim() || "root"}:`),
95689
- issue2.message
95690
- ]),
95691
- { padding: 2 }
95692
- ).print();
95693
- }
95694
- return output.error().exit("error");
95695
- }
95941
+ renderConfigError(result.error);
95696
95942
  }
95697
95943
  });
95698
95944
  return cmd2;
@@ -95714,14 +95960,14 @@ import tar from "tar-fs";
95714
95960
 
95715
95961
  // src/helpers/run-command.ts
95716
95962
  import { exec as exec2 } from "node:child_process";
95717
- import as26 from "ansis";
95963
+ import as27 from "ansis";
95718
95964
  async function runCommand(command, cwd2) {
95719
95965
  return new Promise((resolve, reject) => {
95720
95966
  const comm = exec2(command, { cwd: cwd2 });
95721
95967
  comm.stdout?.pipe(process.stdout);
95722
95968
  comm.stderr?.pipe(process.stderr);
95723
95969
  comm.on("error", (err) => {
95724
- as26.redBright(err.message);
95970
+ as27.redBright(err.message);
95725
95971
  reject(err);
95726
95972
  });
95727
95973
  comm.on("close", (code) => code === 0 ? resolve(true) : reject(code));
@@ -95904,35 +96150,11 @@ var PreviewCommand = () => {
95904
96150
  });
95905
96151
  const parseConfigResult = readAndParseConfig(configPath);
95906
96152
  if (!parseConfigResult.success) {
95907
- const error48 = parseConfigResult.error;
95908
- if (error48.type === "file-not-found") {
95909
- if (Number.isNaN(_port)) {
95910
- return output.error().title("Invalid port").message("Please provide a valid port number").exit("error");
95911
- }
95912
- if (_port < 0 || _port > 65535) {
95913
- return output.error().title("Invalid port").message("Port number must be between 0 and 65535").exit("error");
95914
- }
95915
- }
95916
- if (error48.type === "parse-error") {
95917
- return output.error().title("Invalid configuration file").message("Could not parse the Scalar Configuration file:").message(error48.filePath).exit("error");
95918
- }
95919
- if (error48.type === "validation-error") {
95920
- output.error().title("The given Scalar Configuration is invalid.").message(error48.filePath).print();
95921
- if (error48.issues) {
95922
- output.error().table(
95923
- error48.issues.map((issue2) => [
95924
- as27.yellow(`${issue2.path.join("/").trim() || "root"}:`),
95925
- issue2.message
95926
- ]),
95927
- { padding: 2 }
95928
- ).print();
95929
- }
95930
- }
95931
- return output.error().exit("error");
96153
+ renderConfigError(parseConfigResult.error);
95932
96154
  }
95933
96155
  if (parseConfigResult.success) {
95934
96156
  output.info().line(
95935
- `${as27.green("[SUCCESS]")} ${as27.green("Configuration is valid:")} ${as27.green(parseConfigResult.filePath)}`
96157
+ `${as28.green("[SUCCESS]")} ${as28.green("Configuration is valid:")} ${as28.green(parseConfigResult.filePath)}`
95936
96158
  ).print();
95937
96159
  }
95938
96160
  const { config: config3 } = parseConfigResult;
@@ -95955,7 +96177,7 @@ var PreviewCommand = () => {
95955
96177
 
95956
96178
  // src/domains/project/create/index.ts
95957
96179
  import { text as text5 } from "@clack/prompts";
95958
- import as28 from "ansis";
96180
+ import as29 from "ansis";
95959
96181
  import { Command as Command34 } from "commander";
95960
96182
  var CreateCommand = () => {
95961
96183
  const cmd2 = new Command34("create");
@@ -95995,8 +96217,8 @@ var CreateCommand = () => {
95995
96217
  }
95996
96218
  logger.update("loader", 0, { content: "Project created successfully!" });
95997
96219
  logger.message(
95998
- `Project uid: ${as28.cyan(response.data.uid)}
95999
- Project slug: ${as28.cyan(response.data.slug)}`
96220
+ `Project uid: ${as29.cyan(response.data.uid)}
96221
+ Project slug: ${as29.cyan(response.data.slug)}`
96000
96222
  ).exit("success");
96001
96223
  });
96002
96224
  return cmd2;
@@ -96006,7 +96228,7 @@ Project slug: ${as28.cyan(response.data.slug)}`
96006
96228
  import fs15 from "node:fs/promises";
96007
96229
  import path8 from "node:path";
96008
96230
  import { cancel, confirm as confirm3, isCancel, text as text6 } from "@clack/prompts";
96009
- import as29 from "ansis";
96231
+ import as30 from "ansis";
96010
96232
  import { Command as Command35 } from "commander";
96011
96233
 
96012
96234
  // ../../node_modules/.pnpm/@scalar+galaxy@0.6.7/node_modules/@scalar/galaxy/dist/3.1.json
@@ -97981,14 +98203,14 @@ var InitCommand = () => {
97981
98203
  let validInput;
97982
98204
  const nextSteps = () => {
97983
98205
  output.info().line("What to do next:").line(
97984
- ` ${as29.cyan("scalar project preview")} to preview your project locally`
98206
+ ` ${as30.cyan("scalar project preview")} to preview your project locally`
97985
98207
  ).line(
97986
- ` ${as29.cyan("scalar project check-config")} to validate your scalar.config.json file`
98208
+ ` ${as30.cyan("scalar project check-config")} to validate your scalar.config.json file`
97987
98209
  ).line(
97988
- ` ${as29.cyan("scalar project publish --slug")} ${as29.gray("[dashboard-project-slug]")} to publish your project`
98210
+ ` ${as30.cyan("scalar project publish --slug")} ${as30.gray("[dashboard-project-slug]")} to publish your project`
97989
98211
  ).line(
97990
- as29.white(
97991
- `Run ${as29.magenta("scalar --help")} to see all available commands.`
98212
+ as30.white(
98213
+ `Run ${as30.magenta("scalar --help")} to see all available commands.`
97992
98214
  )
97993
98215
  ).print();
97994
98216
  };
@@ -97999,10 +98221,10 @@ var InitCommand = () => {
97999
98221
  };
98000
98222
  if (await fileExists2(configFile)) {
98001
98223
  output.info().line(
98002
- `${as29.green("\u26A0")} Found existing configuration: ${as29.green.bold(`${configFile}`)}`
98224
+ `${as30.green("\u26A0")} Found existing configuration: ${as30.green.bold(`${configFile}`)}`
98003
98225
  ).print();
98004
98226
  if (force) {
98005
- output.info().line(`${as29.green("\u2714")} Overwriting existing file\u2026`).print();
98227
+ output.info().line(`${as30.green("\u2714")} Overwriting existing file\u2026`).print();
98006
98228
  }
98007
98229
  const shouldOverwriteExisting = force ?? await confirm3({
98008
98230
  message: "Do you want to override the file?",
@@ -98057,7 +98279,7 @@ var InitCommand = () => {
98057
98279
  const slug = slugify3(title);
98058
98280
  configuration.info = { title, description: `Documentation for ${title}` };
98059
98281
  subdomain = slug;
98060
- output.info().line(`${as29.green("\u2714")} Subdomain: ${as29.green(subdomain)}`).print();
98282
+ output.info().line(`${as30.green("\u2714")} Subdomain: ${as30.green(subdomain)}`).print();
98061
98283
  }
98062
98284
  configuration.siteConfig.subdomain = subdomain.trim();
98063
98285
  const content = JSON.stringify(configuration, null, 2);
@@ -98070,10 +98292,10 @@ var InitCommand = () => {
98070
98292
  path8.join(currentDir, DEFAULT_OPENAPI_FILE_NAME),
98071
98293
  JSON.stringify(__default, null, 2)
98072
98294
  );
98073
- output.info().line(`${as29.green("\u2714")} Configuration stored.
98074
- `).line(`${as29.green.bold(`${configFile}`)}
98295
+ output.info().line(`${as30.green("\u2714")} Configuration stored.
98296
+ `).line(`${as30.green.bold(`${configFile}`)}
98075
98297
  `).line(
98076
- `${as29.grey(
98298
+ `${as30.grey(
98077
98299
  content.split("\n").map((line) => ` ${line}`).join("\n")
98078
98300
  )}`
98079
98301
  ).print();
@@ -98083,7 +98305,6 @@ var InitCommand = () => {
98083
98305
  };
98084
98306
 
98085
98307
  // src/domains/project/publish/index.ts
98086
- import fs17 from "node:fs";
98087
98308
  import { dirname } from "node:path";
98088
98309
  import { Command as Command36 } from "commander";
98089
98310
 
@@ -98291,19 +98512,13 @@ var PublishCommand = () => {
98291
98512
  publishUid: publishResult2.publishUid
98292
98513
  });
98293
98514
  }
98294
- const configPath = configPathOption ?? findConfig();
98295
- if (!configPath || !fs17.existsSync(configPath)) {
98296
- return output.error().title("Invalid configuration file").message("Could not find the Scalar Configuration file:").message(configPath ?? "").exit("error");
98297
- }
98298
- const rawConfig = fs17.readFileSync(configPath, "utf-8");
98299
- const configParseResult = parseConfig(rawConfig);
98300
- if (!configParseResult.success) {
98301
- return output.error().title("Invalid configuration file").line(
98302
- "Please check your scalar configuration file to match the specification."
98303
- ).message(configPath).exit("error");
98515
+ const configResult = readAndParseConfig(configPathOption ?? "");
98516
+ if (!configResult.success) {
98517
+ renderConfigError(configResult.error);
98304
98518
  }
98519
+ const { config: config3, filePath: configPath } = configResult;
98305
98520
  const publishResult = await publishProject({
98306
- config: configParseResult.config,
98521
+ config: config3,
98307
98522
  slug,
98308
98523
  configDir: dirname(configPath),
98309
98524
  configPath,
@@ -98379,10 +98594,10 @@ async function getDeployStatus({
98379
98594
  }
98380
98595
 
98381
98596
  // src/domains/project/upgrade/index.ts
98382
- import fs18 from "node:fs/promises";
98597
+ import fs17 from "node:fs/promises";
98383
98598
  import path10 from "node:path";
98384
98599
  import { text as text7 } from "@clack/prompts";
98385
- import as30 from "ansis";
98600
+ import as31 from "ansis";
98386
98601
  import { Command as Command37 } from "commander";
98387
98602
  import { n as n2 } from "neverpanic";
98388
98603
 
@@ -98426,30 +98641,11 @@ var UpgradeCommand2 = () => {
98426
98641
  });
98427
98642
  const parseConfigResult = readAndParseConfig(configPath);
98428
98643
  if (!parseConfigResult.success) {
98429
- const error48 = parseConfigResult.error;
98430
- if (error48.type === "file-not-found") {
98431
- return output.error().title("Scalar configuration could not be found").message("Could not parse the Scalar Configuration file:").message(error48.inputPath).exit("error");
98432
- }
98433
- if (error48.type === "parse-error") {
98434
- return output.error().title("Invalid configuration file").message("Could not parse the Scalar Configuration file:").message(error48.filePath).exit("error");
98435
- }
98436
- if (error48.type === "validation-error") {
98437
- output.error().title("The given Scalar Configuration is invalid.").message(error48.filePath).print();
98438
- if (error48.issues) {
98439
- output.error().table(
98440
- error48.issues.map((issue2) => [
98441
- as30.yellow(`${issue2.path.join("/").trim() || "root"}:`),
98442
- issue2.message
98443
- ]),
98444
- { padding: 2 }
98445
- ).print();
98446
- }
98447
- }
98448
- return output.error().exit("error");
98644
+ renderConfigError(parseConfigResult.error);
98449
98645
  }
98450
98646
  if (parseConfigResult.success) {
98451
98647
  output.info().line(
98452
- `${as30.green("[SUCCESS]")} ${as30.green("Configuration is valid:")} ${as30.green(parseConfigResult.filePath)}`
98648
+ `${as31.green("[SUCCESS]")} ${as31.green("Configuration is valid:")} ${as31.green(parseConfigResult.filePath)}`
98453
98649
  ).print();
98454
98650
  }
98455
98651
  const { config: config3 } = parseConfigResult;
@@ -98468,7 +98664,7 @@ var UpgradeCommand2 = () => {
98468
98664
  const { upgradedConfig, legacyTheme, legacyFooter, legacyScript } = upgradedConfigResult.data;
98469
98665
  if (legacyTheme) {
98470
98666
  const writeUpgradedThemeResult = await n2.fromUnsafe(
98471
- () => fs18.writeFile(
98667
+ () => fs17.writeFile(
98472
98668
  path10.resolve(
98473
98669
  path10.dirname(parseConfigResult.filePath),
98474
98670
  config3.root ?? "./",
@@ -98484,7 +98680,7 @@ var UpgradeCommand2 = () => {
98484
98680
  }
98485
98681
  if (legacyFooter) {
98486
98682
  const writeUpgradedFooterResult = await n2.fromUnsafe(
98487
- () => fs18.writeFile(
98683
+ () => fs17.writeFile(
98488
98684
  path10.resolve(
98489
98685
  path10.dirname(parseConfigResult.filePath),
98490
98686
  config3.root ?? "./",
@@ -98500,7 +98696,7 @@ var UpgradeCommand2 = () => {
98500
98696
  }
98501
98697
  if (legacyScript) {
98502
98698
  const writeUpgradedScriptResult = await n2.fromUnsafe(
98503
- () => fs18.writeFile(
98699
+ () => fs17.writeFile(
98504
98700
  path10.resolve(
98505
98701
  path10.dirname(parseConfigResult.filePath),
98506
98702
  config3.root ?? "./",
@@ -98515,7 +98711,7 @@ var UpgradeCommand2 = () => {
98515
98711
  }
98516
98712
  }
98517
98713
  const writeUpgradedConfigResult = await n2.fromUnsafe(
98518
- () => fs18.writeFile(
98714
+ () => fs17.writeFile(
98519
98715
  parseConfigResult.filePath,
98520
98716
  JSON.stringify(upgradedConfig, null, 2)
98521
98717
  ),
@@ -98549,11 +98745,11 @@ import { Command as Command40 } from "commander";
98549
98745
 
98550
98746
  // src/domains/readme/generate.ts
98551
98747
  import { text as text8 } from "@clack/prompts";
98552
- import as31 from "ansis";
98748
+ import as32 from "ansis";
98553
98749
  import { Command as Command39 } from "commander";
98554
98750
 
98555
98751
  // src/helpers/documentation/index.ts
98556
- import fs19 from "node:fs/promises";
98752
+ import fs18 from "node:fs/promises";
98557
98753
  import path11 from "node:path";
98558
98754
  var generateDocs = (command, depth = 0) => {
98559
98755
  if (command._hidden) return [];
@@ -98583,13 +98779,13 @@ ${docs.content}${codeBlock}`);
98583
98779
  };
98584
98780
  var generateDocumentationFile = async (outputPath) => {
98585
98781
  const commandDocumentation = generateCommandDocumentation(getProgram());
98586
- const template = await fs19.readFile(
98782
+ const template = await fs18.readFile(
98587
98783
  path11.join(import.meta.dirname, "template.md"),
98588
98784
  {
98589
98785
  encoding: "utf-8"
98590
98786
  }
98591
98787
  );
98592
- await fs19.writeFile(
98788
+ await fs18.writeFile(
98593
98789
  outputPath,
98594
98790
  template.replace("<COMMANDS>", commandDocumentation)
98595
98791
  );
@@ -98622,20 +98818,20 @@ function GenerateReadmeCommand() {
98622
98818
  const { executionTimeMs } = await measureTime(
98623
98819
  () => generateDocumentationFile(outputPath)
98624
98820
  );
98625
- output.info().line().title(as31.green("Documentation Generated Successfully! \u{1F389}")).line().message(`\u2728 Documentation has been generated at: ${as31.blue(outputPath)}`).line(
98626
- `\u23F1\uFE0F Generation completed in ${as31.yellow(executionTimeMs.toFixed(2))}ms`
98821
+ output.info().line().title(as32.green("Documentation Generated Successfully! \u{1F389}")).line().message(`\u2728 Documentation has been generated at: ${as32.blue(outputPath)}`).line(
98822
+ `\u23F1\uFE0F Generation completed in ${as32.yellow(executionTimeMs.toFixed(2))}ms`
98627
98823
  ).line("").exit("success");
98628
98824
  });
98629
98825
  return cmd2;
98630
98826
  }
98631
98827
 
98632
98828
  // src/domains/readme/serve.ts
98633
- import fs20 from "node:fs/promises";
98829
+ import fs19 from "node:fs/promises";
98634
98830
  import path12 from "node:path";
98635
- import as32 from "ansis";
98831
+ import as33 from "ansis";
98636
98832
  var fileExists3 = async (filePath) => {
98637
98833
  try {
98638
- await fs20.access(filePath);
98834
+ await fs19.access(filePath);
98639
98835
  return true;
98640
98836
  } catch {
98641
98837
  return false;
@@ -98654,7 +98850,7 @@ function ServeReadmeCommand(cmd2) {
98654
98850
  openBrowser(docsUrl);
98655
98851
  output.info().message(
98656
98852
  "Documentation is being opened in your default browser. If it does not open automatically, please visit the following URL:"
98657
- ).line(as32.blue(docsUrl)).line().exit("success");
98853
+ ).line(as33.blue(docsUrl)).line().exit("success");
98658
98854
  });
98659
98855
  return cmd2;
98660
98856
  }
@@ -98670,7 +98866,7 @@ import { Command as Command46 } from "commander";
98670
98866
 
98671
98867
  // src/domains/registry/publish/index.ts
98672
98868
  import { text as text9 } from "@clack/prompts";
98673
- import as33 from "ansis";
98869
+ import as34 from "ansis";
98674
98870
  import { Command as Command41 } from "commander";
98675
98871
  import { bundle as bundle4 } from "@scalar/json-magic/bundle";
98676
98872
  import { fetchUrls as fetchUrls4, readFiles as readFiles4 } from "@scalar/json-magic/bundle/plugins/node";
@@ -98813,7 +99009,7 @@ var PublishCommand2 = () => {
98813
99009
  RegistryAsset2.Apis,
98814
99010
  matchingApi?.uid ?? publishRes.data.uid
98815
99011
  );
98816
- output.info().line(`${as33.green("\u279C")} ${as33.white.bold("View in dashboard:")}`).line(as33.cyan(apiUrl)).line().line(`${as33.green("\u279C")} ${as33.white.bold("Registry Preview:")}`).line(as33.cyan(registryUrl(api.url({ version: version3 })))).line().line(`${as33.green("\u279C")} ${as33.white.bold("Registry YAML:")}`).line(as33.cyan(registryUrl(api.url({ version: version3, format: "yaml" })))).line().line(`${as33.green("\u279C")} ${as33.white.bold("Registry JSON:")}`).line(as33.cyan(registryUrl(api.url({ version: version3, format: "json" })))).print();
99012
+ output.info().line(`${as34.green("\u279C")} ${as34.white.bold("View in dashboard:")}`).line(as34.cyan(apiUrl)).line().line(`${as34.green("\u279C")} ${as34.white.bold("Registry Preview:")}`).line(as34.cyan(registryUrl(api.url({ version: version3 })))).line().line(`${as34.green("\u279C")} ${as34.white.bold("Registry YAML:")}`).line(as34.cyan(registryUrl(api.url({ version: version3, format: "yaml" })))).line().line(`${as34.green("\u279C")} ${as34.white.bold("Registry JSON:")}`).line(as34.cyan(registryUrl(api.url({ version: version3, format: "json" })))).print();
98817
99013
  });
98818
99014
  return cmd2;
98819
99015
  };
@@ -98838,7 +99034,7 @@ var DeleteCommand = () => {
98838
99034
  };
98839
99035
 
98840
99036
  // src/domains/registry/get/index.ts
98841
- import fs21 from "node:fs/promises";
99037
+ import fs20 from "node:fs/promises";
98842
99038
  import { Command as Command43 } from "commander";
98843
99039
  var versionSchema4 = external_exports.union([docVersionSchema, external_exports.literal("latest")]);
98844
99040
  var GetCommand = () => {
@@ -98889,7 +99085,7 @@ var GetCommand = () => {
98889
99085
  `;
98890
99086
  if (result.data.output) {
98891
99087
  try {
98892
- await fs21.writeFile(result.data.output, withTrailingNewline, "utf8");
99088
+ await fs20.writeFile(result.data.output, withTrailingNewline, "utf8");
98893
99089
  } catch (error48) {
98894
99090
  const message = error48 instanceof Error && error48.message.length > 0 ? error48.message : `Could not write to ${result.data.output}.`;
98895
99091
  output.error().title("Unable to write document to file").message(message).exit("error");
@@ -98906,7 +99102,7 @@ var GetCommand = () => {
98906
99102
  };
98907
99103
 
98908
99104
  // src/domains/registry/list/index.ts
98909
- import as34 from "ansis";
99105
+ import as35 from "ansis";
98910
99106
  import { Command as Command44 } from "commander";
98911
99107
  var ListCommand = () => {
98912
99108
  const cmd2 = new Command44("list");
@@ -98945,17 +99141,17 @@ var ListCommand = () => {
98945
99141
  output.info().table(
98946
99142
  [
98947
99143
  [
98948
- as34.underline.bold("Slug"),
98949
- as34.underline.bold("Title"),
98950
- as34.underline.bold("Version"),
98951
- as34.underline.bold("Privacy")
99144
+ as35.underline.bold("Slug"),
99145
+ as35.underline.bold("Title"),
99146
+ as35.underline.bold("Version"),
99147
+ as35.underline.bold("Privacy")
98952
99148
  ],
98953
99149
  ...listApisRes.data.map((api) => {
98954
99150
  return [
98955
- as34.blue(api.slug),
98956
- as34.blue(api.title),
98957
- as34.blue(api.version),
98958
- api.isPrivate ? as34.green("Private") : as34.yellow("Public")
99151
+ as35.blue(api.slug),
99152
+ as35.blue(api.title),
99153
+ as35.blue(api.version),
99154
+ api.isPrivate ? as35.green("Private") : as35.yellow("Public")
98959
99155
  ];
98960
99156
  })
98961
99157
  ],
@@ -98967,7 +99163,7 @@ var ListCommand = () => {
98967
99163
 
98968
99164
  // src/domains/registry/update/index.ts
98969
99165
  import { text as text10 } from "@clack/prompts";
98970
- import as35 from "ansis";
99166
+ import as36 from "ansis";
98971
99167
  import { Command as Command45 } from "commander";
98972
99168
  var UpdateCommand = () => {
98973
99169
  const cmd2 = new Command45("update");
@@ -98989,12 +99185,12 @@ var UpdateCommand = () => {
98989
99185
  const shouldPrompt = ![title, description].some((it) => it !== void 0);
98990
99186
  if (!titleValue && shouldPrompt) {
98991
99187
  titleValue = await text10({
98992
- message: `What is the new title of your document? ${as35.grey("(Optional)")}`
99188
+ message: `What is the new title of your document? ${as36.grey("(Optional)")}`
98993
99189
  });
98994
99190
  }
98995
99191
  if (!descriptionValue && shouldPrompt) {
98996
99192
  descriptionValue = await text10({
98997
- message: `What is the new description of your document? ${as35.grey("(Optional)")}`
99193
+ message: `What is the new description of your document? ${as36.grey("(Optional)")}`
98998
99194
  });
98999
99195
  }
99000
99196
  if (!titleValue && !descriptionValue) {
@@ -99033,7 +99229,7 @@ var registry_default = registryDomain;
99033
99229
  import { Command as Command49 } from "commander";
99034
99230
 
99035
99231
  // src/domains/team/list/index.ts
99036
- import as36 from "ansis";
99232
+ import as37 from "ansis";
99037
99233
  import { Command as Command47 } from "commander";
99038
99234
 
99039
99235
  // src/domains/team/helpers.ts
@@ -99062,7 +99258,7 @@ var ListCommand2 = () => {
99062
99258
  output.info().table(
99063
99259
  teams.data.map((it) => {
99064
99260
  const isCurrentTeam = it.teamUid === auth.teamUid;
99065
- const color = isCurrentTeam ? as36.green : as36.blue;
99261
+ const color = isCurrentTeam ? as37.green : as37.blue;
99066
99262
  const teamName = isCurrentTeam ? `${it.teamName} (default)` : it.teamName;
99067
99263
  return [isCurrentTeam ? color("\u279C") : " ", color(teamName)];
99068
99264
  }),
@@ -99074,7 +99270,7 @@ var ListCommand2 = () => {
99074
99270
 
99075
99271
  // src/domains/team/set/index.ts
99076
99272
  import { select as select7 } from "@clack/prompts";
99077
- import as37 from "ansis";
99273
+ import as38 from "ansis";
99078
99274
  import { Command as Command48 } from "commander";
99079
99275
  var SetCommand = () => {
99080
99276
  const cmd2 = new Command48("set");
@@ -99109,7 +99305,7 @@ var SetCommand = () => {
99109
99305
  }
99110
99306
  await refreshToken(auth.refreshToken, teamValue);
99111
99307
  output.info().message(
99112
- `Operation ${as37.green("successful")}. Selected team: ${as37.cyan(selectedTeam.teamName)}`
99308
+ `Operation ${as38.green("successful")}. Selected team: ${as38.cyan(selectedTeam.teamName)}`
99113
99309
  ).print();
99114
99310
  });
99115
99311
  return cmd2;
@@ -99124,11 +99320,11 @@ var team_default = teamDomain;
99124
99320
 
99125
99321
  // src/domains/upgrade/index.ts
99126
99322
  import { execSync } from "node:child_process";
99127
- import as39 from "ansis";
99323
+ import as40 from "ansis";
99128
99324
  import { Command as Command50 } from "commander";
99129
99325
 
99130
99326
  // src/helpers/upgrade.ts
99131
- import as38 from "ansis";
99327
+ import as39 from "ansis";
99132
99328
  import semver5 from "semver";
99133
99329
  var packageJsonSchema = external_exports.object({
99134
99330
  version: external_exports.string()
@@ -99156,7 +99352,7 @@ async function getUpgradeInformation() {
99156
99352
  }
99157
99353
  async function checkUpgrade() {
99158
99354
  const emitOutput = () => output.info().message(
99159
- `New version available! Run ${as38.cyan("`scalar upgrade`")} to install the latest version`
99355
+ `New version available! Run ${as39.cyan("`scalar upgrade`")} to install the latest version`
99160
99356
  ).print();
99161
99357
  const now = performance.now();
99162
99358
  const delay = 1 * 60 * 60 * 1e3;
@@ -99198,7 +99394,7 @@ cmd.action(async () => {
99198
99394
  });
99199
99395
  output.info().message("Successfully upgraded to the latest version").print();
99200
99396
  } catch {
99201
- output.error().title("Upgrade failed").message("Failed to upgrade the CLI. Please try running:").message(as39.cyan(`npm install -g ${upgradeStatus.name}@latest`)).exit("error");
99397
+ output.error().title("Upgrade failed").message("Failed to upgrade the CLI. Please try running:").message(as40.cyan(`npm install -g ${upgradeStatus.name}@latest`)).exit("error");
99202
99398
  }
99203
99399
  });
99204
99400
  var upgrade_default = cmd;