@scalar/cli 2.10.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +84 -1289
  2. package/chunks/action-2OPUQFUY.js +164 -0
  3. package/chunks/{action-4GZI2M5B.js → action-36LZ6XXE.js} +19 -17
  4. package/chunks/{action-KDUFU7TZ.js → action-3XMTJJRT.js} +19 -16
  5. package/chunks/{action-R4PGILN4.js → action-6CLEENBI.js} +47 -36
  6. package/chunks/{action-ZFI77WA5.js → action-7HXYZPOT.js} +10 -10
  7. package/chunks/{action-X7BA7PQQ.js → action-AC5ENU6Z.js} +20 -18
  8. package/chunks/{action-PPTFYZWD.js → action-ADGLTNFC.js} +28 -22
  9. package/chunks/{action-7XOHYWYM.js → action-AOKHLTZ6.js} +25 -21
  10. package/chunks/{action-XOADBXSX.js → action-AVSJ3AJY.js} +17 -16
  11. package/chunks/{action-GFLRD7LO.js → action-D3IVCY24.js} +8 -8
  12. package/chunks/action-EBZJS367.js +130 -0
  13. package/chunks/{action-ZKA3RR3S.js → action-EZXHSAJ2.js} +18 -17
  14. package/chunks/{action-5LF4XYHX.js → action-FDTVHVHF.js} +12 -12
  15. package/chunks/{action-JEYDBB3P.js → action-FUO5F7NV.js} +15 -15
  16. package/chunks/{action-DKDRAIKV.js → action-HA3CMV3P.js} +13 -15
  17. package/chunks/{action-YSVTZVKV.js → action-IG3BK2LF.js} +37 -26
  18. package/chunks/{action-H3RTILLM.js → action-IIQMZVRJ.js} +1 -1
  19. package/chunks/{action-DTEO4YNX.js → action-JT6C472I.js} +13 -11
  20. package/chunks/{action-UUL6SWV4.js → action-KDT6H6ML.js} +12 -14
  21. package/chunks/{action-PAM2EZ22.js → action-KJDIJQ3A.js} +8 -7
  22. package/chunks/{action-HT42NUUX.js → action-NF5E7JKA.js} +40 -38
  23. package/chunks/{action-EAUTQ77U.js → action-NIZBME45.js} +26 -24
  24. package/chunks/{action-CB55NWAU.js → action-O757TFA2.js} +9 -9
  25. package/chunks/{action-XLE37MZL.js → action-ONR7QSN7.js} +23 -22
  26. package/chunks/{action-5RL4NWUZ.js → action-QM2BMMHG.js} +33 -30
  27. package/chunks/{action-GWYYTUTM.js → action-QVTAZCKY.js} +5 -5
  28. package/chunks/action-SLB52XRG.js +65 -0
  29. package/chunks/{action-CABLS46Q.js → action-UTFRCKGE.js} +11 -11
  30. package/chunks/{action-4W5GUGEG.js → action-VESBFIP3.js} +20 -19
  31. package/chunks/{action-657A4K2D.js → action-VGFAIFYE.js} +26 -23
  32. package/chunks/action-WCU5O2VT.js +100 -0
  33. package/chunks/{action-TOBU74JH.js → action-XS5EESHW.js} +51 -27
  34. package/chunks/action-XVNRZ5VX.js +38 -0
  35. package/chunks/action-Y7EBKCUU.js +16 -0
  36. package/chunks/{action-5N3P43MD.js → action-YWQ2OKS3.js} +16 -15
  37. package/chunks/{actions-3SAMH7A5.js → actions-6QG7LH7P.js} +23 -20
  38. package/chunks/{agent-2ESZI7NO.js → agent-ONXROEAE.js} +44 -9
  39. package/chunks/{asyncapi-4HGVM3PR.js → asyncapi-7IFXAIE3.js} +13 -12
  40. package/chunks/{build.action-VBGFGACM.js → build.action-FI4OWY3T.js} +28 -26
  41. package/chunks/{chunk-ZGNDXPLU.js → chunk-26VIHQGL.js} +3 -3
  42. package/chunks/{chunk-JXGF5EHC.js → chunk-3HCEUGOE.js} +42 -13
  43. package/chunks/{chunk-G4HRW2FZ.js → chunk-5TNKTLQP.js} +370 -254
  44. package/chunks/{chunk-XAGJJNQW.js → chunk-BB6WWG25.js} +10 -10
  45. package/chunks/{chunk-K2HIB5BA.js → chunk-BCFUMXMC.js} +3 -3
  46. package/chunks/{action-F2ZJNURT.js → chunk-EBNFCIKS.js} +7 -10
  47. package/chunks/{chunk-MC4EMNOR.js → chunk-EJSGWV2K.js} +7 -6
  48. package/chunks/{chunk-GYRQPDTK.js → chunk-FJCOYEKT.js} +139 -3
  49. package/chunks/{chunk-ZKJPLWRJ.js → chunk-HU47OMI4.js} +4 -4
  50. package/chunks/{chunk-VVRUSQCY.js → chunk-I57ID5K7.js} +13 -0
  51. package/chunks/{chunk-43WALAW3.js → chunk-JLNHOA5Z.js} +64 -115
  52. package/chunks/{chunk-5SMP756H.js → chunk-LCSU43NJ.js} +2 -2
  53. package/chunks/{chunk-KHF2QXBG.js → chunk-N645RGAB.js} +1853 -683
  54. package/chunks/{chunk-3ZJYGGAA.js → chunk-ORCUZITN.js} +1 -1
  55. package/chunks/{chunk-H467HDVV.js → chunk-PERC34BV.js} +1 -1
  56. package/chunks/chunk-Q26DFKTY.js +37 -0
  57. package/chunks/{chunk-MMWSCTDB.js → chunk-QJQTSRU4.js} +19 -19
  58. package/chunks/{chunk-WDIWLXLV.js → chunk-RLBS4HJT.js} +3 -3
  59. package/chunks/{chunk-ATNTXKMS.js → chunk-RNZVZMYC.js} +198 -42
  60. package/chunks/{chunk-IPZP3VRA.js → chunk-RYWXF3LO.js} +12 -21
  61. package/chunks/{chunk-CWVYOXXM.js → chunk-SNOAL2C5.js} +11 -7
  62. package/chunks/{chunk-UDBSV3CK.js → chunk-T3R66THO.js} +6085 -4167
  63. package/chunks/{chunk-VYFGRLVQ.js → chunk-U73OW57G.js} +1 -1
  64. package/chunks/chunk-U764PQUA.js +1034 -0
  65. package/chunks/{chunk-KZNRQVMY.js → chunk-UAFCSWQ6.js} +1 -1
  66. package/chunks/{chunk-WB6PWTMU.js → chunk-UBLFIMUA.js} +1 -1
  67. package/chunks/{chunk-WIEXQUTD.js → chunk-UODTHS76.js} +1 -1
  68. package/chunks/chunk-V3MYP5SQ.js +247 -0
  69. package/chunks/{chunk-36LXIJIZ.js → chunk-V6LUKXBV.js} +1 -16
  70. package/chunks/{chunk-6M7TL2G2.js → chunk-VRZSDUZK.js} +45 -5
  71. package/chunks/{chunk-GLWTVLKM.js → chunk-VUNOOPEG.js} +9 -2
  72. package/chunks/chunk-VUXPDHTQ.js +22 -0
  73. package/chunks/{chunk-DHZW7Q7U.js → chunk-VVQOFG76.js} +2 -4
  74. package/chunks/chunk-XP5UM7SF.js +21 -0
  75. package/chunks/{chunk-ZYBLQ5CT.js → chunk-Y6C3H27E.js} +9 -4
  76. package/chunks/{chunk-35Z7VTJT.js → chunk-YTFFBGNQ.js} +52 -38
  77. package/chunks/{chunk-BIMLCGKS.js → chunk-ZNLMQKDU.js} +1 -1
  78. package/chunks/{create.action-DBNIS665.js → create.action-PPMZEMZL.js} +34 -32
  79. package/chunks/{delete.action-GBOZC45K.js → delete.action-GDOHATRZ.js} +30 -28
  80. package/chunks/{delete.action-K7BLK7DK.js → delete.action-VAHKEHEU.js} +29 -27
  81. package/chunks/{get.action-QHKMYZBK.js → get.action-UXFTGO7W.js} +24 -20
  82. package/chunks/{get.action-N3JOY3OU.js → get.action-XON3EZDT.js} +16 -15
  83. package/chunks/{list.action-TJCS6UEY.js → list.action-24F5WDGR.js} +37 -26
  84. package/chunks/{list.action-6SSO3JVN.js → list.action-OQEAEJ5U.js} +39 -29
  85. package/chunks/{publish.action-T24VHRMR.js → publish.action-G7FPDRBZ.js} +45 -43
  86. package/chunks/{scripts-VIBLGKYG.js → scripts-6CI6U32J.js} +1 -1
  87. package/chunks/{update.action-VOE6PH5F.js → update.action-IFIFXZWA.js} +29 -27
  88. package/chunks/{update.action-OGYNBXRU.js → update.action-MJDHVVR3.js} +30 -28
  89. package/index.js +290 -284
  90. package/package.json +2 -2
  91. package/skills/scalar-cli/SKILL.md +49 -49
  92. package/template.md +68 -252
  93. package/chunks/action-FBRY5JKU.js +0 -37
  94. package/chunks/action-LYCNT3KA.js +0 -73
  95. package/chunks/action-OJ2NK25F.js +0 -121
  96. package/chunks/action-U2L5DCFG.js +0 -91
  97. package/chunks/chunk-MNNGUUKJ.js +0 -405
  98. package/chunks/chunk-ZGVZU6L2.js +0 -422
  99. package/docs.html +0 -6977
@@ -7,7 +7,7 @@ function createError(code, detail) {
7
7
  detail
8
8
  };
9
9
  }
10
- function displayError(error, fallback = "Unknown error occurred. Please contact support@scalar.com") {
10
+ function displayError(error, fallback = "An unexpected error occurred. Contact support@scalar.com with the command and error details.") {
11
11
  try {
12
12
  if (error instanceof Error) {
13
13
  return error.message;
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  detectManagedDocType
4
- } from "./chunk-GLWTVLKM.js";
4
+ } from "./chunk-VUNOOPEG.js";
5
5
 
6
6
  // src/domains/document/helpers/safe-normalize.ts
7
7
  import { normalize } from "@scalar/json-magic/helpers/normalize";
@@ -0,0 +1,37 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ external_exports
4
+ } from "./chunk-I57ID5K7.js";
5
+
6
+ // ../../packages/entities/dist/environment/schema.js
7
+ var DEFAULT_ENVIRONMENT = "production";
8
+ var RESERVED_ENVIRONMENT_SLUGS = ["latest", "all"];
9
+ var ENVIRONMENT_SLUG_PATTERN = /^[a-z][a-z0-9-]{0,62}[a-z0-9]$/;
10
+ var MAX_TEAM_ENVIRONMENTS = 100;
11
+ var environmentSlugSchema = external_exports.string().regex(ENVIRONMENT_SLUG_PATTERN, {
12
+ message: "Environment slugs are 2 to 64 lowercase letters, digits or hyphens, starting with a letter and ending with a letter or digit."
13
+ }).refine((slug) => !RESERVED_ENVIRONMENT_SLUGS.includes(slug), {
14
+ message: `Environment slugs cannot be ${RESERVED_ENVIRONMENT_SLUGS.join(" or ")}.`
15
+ }).meta({ id: "environment-slug", examples: ["staging"] });
16
+ var teamEnvironmentSchema = external_exports.object({
17
+ slug: environmentSlugSchema,
18
+ name: external_exports.string().max(50),
19
+ /** Git branch globs that resolve here. List order is match order. */
20
+ branches: external_exports.string().array().default([])
21
+ }).meta({ id: "team-environment" });
22
+ var defaultTeamEnvironments = () => [
23
+ { slug: "development", name: "Development", branches: ["develop", "dev"] },
24
+ { slug: "staging", name: "Staging", branches: ["staging", "release/*"] },
25
+ {
26
+ slug: DEFAULT_ENVIRONMENT,
27
+ name: "Production",
28
+ branches: ["main", "master"]
29
+ }
30
+ ];
31
+
32
+ export {
33
+ MAX_TEAM_ENVIRONMENTS,
34
+ environmentSlugSchema,
35
+ teamEnvironmentSchema,
36
+ defaultTeamEnvironments
37
+ };
@@ -1,16 +1,32 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  RegistryAsset
4
- } from "./chunk-GLWTVLKM.js";
4
+ } from "./chunk-VUNOOPEG.js";
5
5
  import {
6
6
  contentShaSchema
7
- } from "./chunk-MNNGUUKJ.js";
7
+ } from "./chunk-U764PQUA.js";
8
8
  import {
9
9
  docVersionSchema,
10
10
  external_exports,
11
11
  namespaceSchema,
12
12
  nanoidSchema
13
- } from "./chunk-VVRUSQCY.js";
13
+ } from "./chunk-I57ID5K7.js";
14
+
15
+ // ../../packages/urls/dist/publish/full.js
16
+ function getPublishUrl(domain, subpath) {
17
+ const url = `https://${domain}${subpath ?? ""}`;
18
+ return new URL(url).toString();
19
+ }
20
+
21
+ // ../../packages/urls/dist/publish/previews.js
22
+ function getPublishPreviewUrl(publishUid, domain, subpath = "") {
23
+ const url = `https://${getPublishPreviewDomain(publishUid, domain)}${subpath ?? ""}`;
24
+ new URL(url);
25
+ return url;
26
+ }
27
+ function getPublishPreviewDomain(publishUid, domain) {
28
+ return `${publishUid}--${domain}`;
29
+ }
14
30
 
15
31
  // ../../packages/urls/dist/registry/path-generators.js
16
32
  function versionFormat(version) {
@@ -190,22 +206,6 @@ function registry(teamNamespace) {
190
206
  var artifactUidSchema = nanoidSchema.regex(/^[a-zA-Z0-9_-]+$/, "Artifact uids must be a single path segment");
191
207
  var artifactLanguageSchema = external_exports.string().regex(/^[a-z0-9]+$/, "Artifact languages must be a single path segment");
192
208
 
193
- // ../../packages/urls/dist/publish/full.js
194
- function getPublishUrl(domain, subpath) {
195
- const url = `https://${domain}${subpath ?? ""}`;
196
- return new URL(url).toString();
197
- }
198
-
199
- // ../../packages/urls/dist/publish/previews.js
200
- function getPublishPreviewUrl(publishUid, domain, subpath = "") {
201
- const url = `https://${getPublishPreviewDomain(publishUid, domain)}${subpath ?? ""}`;
202
- new URL(url);
203
- return url;
204
- }
205
- function getPublishPreviewDomain(publishUid, domain) {
206
- return `${publishUid}--${domain}`;
207
- }
208
-
209
209
  export {
210
210
  getPublishUrl,
211
211
  getPublishPreviewUrl,
@@ -1,15 +1,15 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  getAuthData
4
- } from "./chunk-35Z7VTJT.js";
4
+ } from "./chunk-YTFFBGNQ.js";
5
5
  import {
6
6
  config
7
- } from "./chunk-WB6PWTMU.js";
7
+ } from "./chunk-UBLFIMUA.js";
8
8
  import {
9
9
  external_exports,
10
10
  objectSchema,
11
11
  schemaModel
12
- } from "./chunk-VVRUSQCY.js";
12
+ } from "./chunk-I57ID5K7.js";
13
13
 
14
14
  // ../../packages/mongobase-client/dist/database/access.js
15
15
  var primitiveSchema = external_exports.union([
@@ -14,21 +14,29 @@ import {
14
14
  webhookSubscriptionSchema,
15
15
  workspaceSchema,
16
16
  workspaceVersionSchema
17
- } from "./chunk-43WALAW3.js";
17
+ } from "./chunk-JLNHOA5Z.js";
18
18
  import {
19
19
  userSchema
20
- } from "./chunk-ZYBLQ5CT.js";
20
+ } from "./chunk-Y6C3H27E.js";
21
21
  import {
22
22
  sdkSchema
23
- } from "./chunk-IPZP3VRA.js";
23
+ } from "./chunk-RYWXF3LO.js";
24
24
  import {
25
+ mcpEnvironmentSchema
26
+ } from "./chunk-V3MYP5SQ.js";
27
+ import {
28
+ RENEWAL_MARGIN_MS,
29
+ SESSION_EXPIRED,
30
+ SESSION_MOVED,
25
31
  generateAccessByPersonalToken,
26
32
  getAuthData,
27
- refreshToken
28
- } from "./chunk-35Z7VTJT.js";
33
+ needsRenewal,
34
+ refreshToken,
35
+ renewAuth
36
+ } from "./chunk-YTFFBGNQ.js";
29
37
  import {
30
38
  config
31
- } from "./chunk-WB6PWTMU.js";
39
+ } from "./chunk-UBLFIMUA.js";
32
40
  import {
33
41
  UnifiedDocsMigrationStatus,
34
42
  pendingInviteSchema,
@@ -37,35 +45,37 @@ import {
37
45
  teamNameSchema,
38
46
  teamSdkPricing,
39
47
  userRefSchema
40
- } from "./chunk-GYRQPDTK.js";
48
+ } from "./chunk-FJCOYEKT.js";
41
49
  import {
42
50
  docsProjectSchema,
43
51
  githubInstallSchema,
44
52
  githubProjectSchema,
45
53
  themeSchema
46
- } from "./chunk-6M7TL2G2.js";
54
+ } from "./chunk-VRZSDUZK.js";
47
55
  import {
48
56
  managedDocSchema,
49
57
  managedDocVersionSchema,
50
58
  ruleSchema
51
- } from "./chunk-GLWTVLKM.js";
59
+ } from "./chunk-VUNOOPEG.js";
52
60
  import {
61
+ createdMcpServerSchema,
53
62
  docInstanceSchema,
54
63
  docSourceSchema,
55
64
  docVersionRecordSchema,
65
+ mcpServerSchema,
56
66
  registryGitBindingSchema,
57
- registryPublishRecordSchema
58
- } from "./chunk-MNNGUUKJ.js";
67
+ registryPublishRecordSchema,
68
+ secretMetadataSchema
69
+ } from "./chunk-U764PQUA.js";
59
70
  import {
60
- mcpInstallationSchema,
61
- mcpServerSchema
62
- } from "./chunk-ZGVZU6L2.js";
71
+ teamEnvironmentSchema
72
+ } from "./chunk-Q26DFKTY.js";
63
73
  import {
64
74
  external_exports,
65
75
  nanoidSchema,
66
76
  schemaModel,
67
77
  slugSchema
68
- } from "./chunk-VVRUSQCY.js";
78
+ } from "./chunk-I57ID5K7.js";
69
79
 
70
80
  // ../../packages/service-api/dist/apis/access-groups.js
71
81
  function accessGroupsApiFactory(requestService) {
@@ -198,6 +208,23 @@ var topReferrerSchema = external_exports.object({
198
208
  var topReferrersResultSchema = external_exports.object({
199
209
  referrers: external_exports.array(topReferrerSchema)
200
210
  });
211
+ var feedbackReasonCountSchema = external_exports.object({
212
+ reason: external_exports.string(),
213
+ count: external_exports.number().int().nonnegative()
214
+ });
215
+ var feedbackPageSchema = external_exports.object({
216
+ path: external_exports.string(),
217
+ helpful: external_exports.number().int().nonnegative(),
218
+ unhelpful: external_exports.number().int().nonnegative(),
219
+ reasons: external_exports.array(feedbackReasonCountSchema)
220
+ });
221
+ var feedbackResultSchema = external_exports.object({
222
+ totals: external_exports.object({
223
+ helpful: external_exports.number().int().nonnegative(),
224
+ unhelpful: external_exports.number().int().nonnegative()
225
+ }),
226
+ pages: external_exports.array(feedbackPageSchema)
227
+ });
201
228
  var consumersResultSchema = external_exports.object({
202
229
  totals: external_exports.object({
203
230
  human: external_exports.number().int().nonnegative(),
@@ -264,11 +291,22 @@ function analyticsApiFactory(requestService) {
264
291
  schema: consumersResultSchema
265
292
  });
266
293
  }
294
+ async function getFeedback(projectUid, args = {}) {
295
+ return requestService.request({
296
+ url: `core/analytics/projects/${projectUid}/feedback${buildQuery({
297
+ range: args.range,
298
+ limit: args.limit
299
+ })}`,
300
+ method: "get",
301
+ schema: feedbackResultSchema
302
+ });
303
+ }
267
304
  return {
268
305
  getOverview,
269
306
  getPages,
270
307
  getReferrers,
271
- getConsumers
308
+ getConsumers,
309
+ getFeedback
272
310
  };
273
311
  }
274
312
 
@@ -719,10 +757,6 @@ function managedSchemasApiFactory(requestService) {
719
757
  }
720
758
 
721
759
  // ../../packages/service-api/dist/apis/mcp-servers.js
722
- var createdMcpServerSchema = external_exports.object({
723
- server: mcpServerSchema,
724
- installation: mcpInstallationSchema
725
- });
726
760
  function mcpServersApiFactory(requestService) {
727
761
  async function create(data) {
728
762
  return await requestService.request({
@@ -748,6 +782,17 @@ function mcpServersApiFactory(requestService) {
748
782
  schema: mcpServerSchema
749
783
  });
750
784
  }
785
+ async function saveEnvironments(uid, environments) {
786
+ return await requestService.request({
787
+ url: `core/v1/mcp-servers/${uid}/environments`,
788
+ method: "put",
789
+ data: { environments },
790
+ schema: external_exports.object({
791
+ environments: external_exports.record(external_exports.string(), mcpEnvironmentSchema),
792
+ rows: external_exports.object({ slug: external_exports.string(), id: external_exports.string() }).array()
793
+ })
794
+ });
795
+ }
751
796
  async function del(uid) {
752
797
  return await requestService.request({
753
798
  url: `core/v1/mcp-servers/${uid}`,
@@ -781,6 +826,7 @@ function mcpServersApiFactory(requestService) {
781
826
  create,
782
827
  createInstant,
783
828
  update,
829
+ saveEnvironments,
784
830
  delete: del,
785
831
  claimDomain,
786
832
  releaseDomain,
@@ -898,13 +944,20 @@ function registryGitApiFactory(requestService) {
898
944
  })
899
945
  });
900
946
  }
901
- async function listBranches(asset, namespace, slug) {
947
+ async function listBranches(asset, namespace, slug, opts) {
948
+ const params = new URLSearchParams();
949
+ if (opts?.query)
950
+ params.set("query", opts.query);
951
+ if (opts?.perPage)
952
+ params.set("perPage", String(opts.perPage));
953
+ const qs = params.size ? `?${params}` : "";
902
954
  return await requestService.request({
903
- url: `${base(asset, namespace, slug)}/branches`,
955
+ url: `${base(asset, namespace, slug)}/branches${qs}`,
904
956
  method: "get",
905
957
  schema: external_exports.object({
906
958
  branches: external_exports.object({ name: external_exports.string(), sha: external_exports.string() }).array(),
907
- trackedBranch: external_exports.string()
959
+ trackedBranch: external_exports.string(),
960
+ hasMore: external_exports.boolean().optional()
908
961
  })
909
962
  });
910
963
  }
@@ -1361,6 +1414,43 @@ function sdksApiFactory(requestService) {
1361
1414
  };
1362
1415
  }
1363
1416
 
1417
+ // ../../packages/service-api/dist/apis/team-secrets.js
1418
+ function teamSecretsApiFactory(requestService) {
1419
+ return {
1420
+ /** The team's secrets, or its vars, in one environment */
1421
+ list: (environment, kind = "secret") => requestService.request({
1422
+ url: `core/team/secrets?${new URLSearchParams({ environment, kind })}`,
1423
+ method: "get",
1424
+ schema: external_exports.object({ secrets: secretMetadataSchema.array() })
1425
+ }),
1426
+ /**
1427
+ * Create the name in the environment as a secret or a var. A name the
1428
+ * environment already holds is refused with a 409 in `create` mode, which
1429
+ * core applies to every caller who is not a team admin; a team admin's
1430
+ * write without a mode replaces its value.
1431
+ */
1432
+ create: (data) => requestService.request({
1433
+ url: "core/team/secrets",
1434
+ method: "post",
1435
+ data,
1436
+ schema: secretMetadataSchema
1437
+ }),
1438
+ /** Replace the value of the secret or var with this uid */
1439
+ rotate: (uid, value) => requestService.request({
1440
+ url: `core/team/secrets/${encodeURIComponent(uid)}/rotate`,
1441
+ method: "post",
1442
+ data: { value },
1443
+ schema: secretMetadataSchema
1444
+ }),
1445
+ /** Delete the secret or var with this uid */
1446
+ delete: (uid) => requestService.request({
1447
+ url: `core/team/secrets/${encodeURIComponent(uid)}`,
1448
+ method: "delete",
1449
+ schema: external_exports.null()
1450
+ })
1451
+ };
1452
+ }
1453
+
1364
1454
  // ../../packages/service-api/dist/apis/themes.js
1365
1455
  function themesApiFactory(requestService) {
1366
1456
  async function get(slug) {
@@ -1496,7 +1586,10 @@ function waitlistApiFactory(requestService) {
1496
1586
  }
1497
1587
 
1498
1588
  // ../../packages/service-api/dist/apis/webhooks.js
1499
- var subscriptionSchema = webhookSubscriptionSchema.omit({ teamUid: true });
1589
+ var subscriptionSchema = webhookSubscriptionSchema.omit({
1590
+ teamUid: true,
1591
+ signingSecretUid: true
1592
+ });
1500
1593
  var deliverySchema = webhookDeliverySchema.omit({ teamUid: true });
1501
1594
  var webhooksApiFactory = (requestService) => {
1502
1595
  const create = async (data) => {
@@ -1690,7 +1783,13 @@ function requestServiceFactory(baseUrl, getAuthToken, logger = console) {
1690
1783
  if (data instanceof FormData)
1691
1784
  delete headers["content-type"];
1692
1785
  if (!disableAuth && (getAuthToken || config2.token)) {
1693
- const token = (getAuthToken ? getAuthToken() : config2.token)?.trim();
1786
+ let token;
1787
+ try {
1788
+ const provided = getAuthToken ? getAuthToken() : config2.token;
1789
+ token = (provided instanceof Promise ? await provided : provided)?.trim();
1790
+ } catch (error) {
1791
+ return formatApiError(error instanceof Error ? error.message : "Could not get a token", 401, null, "unauthenticated");
1792
+ }
1694
1793
  if (token) {
1695
1794
  headers.authorization = `Bearer ${token}`;
1696
1795
  } else {
@@ -1899,6 +1998,33 @@ function bitbucketApiFactory(requestService) {
1899
1998
  })
1900
1999
  });
1901
2000
  }
2001
+ async function createDocsProjectBitbucketPullRequest(uid, data) {
2002
+ return await requestService.request({
2003
+ url: `core/vcs/bitbucket/docs-project/${uid}/pull-request`,
2004
+ method: "post",
2005
+ data,
2006
+ schema: external_exports.object({
2007
+ url: external_exports.string(),
2008
+ number: external_exports.number(),
2009
+ alreadyExists: external_exports.boolean()
2010
+ })
2011
+ });
2012
+ }
2013
+ async function getDocsProjectBitbucketPullRequestForBranch(uid, branch) {
2014
+ const qs = new URLSearchParams({ branch }).toString();
2015
+ return await requestService.request({
2016
+ url: `core/vcs/bitbucket/docs-project/${uid}/pull-request/for-branch?${qs}`,
2017
+ method: "get",
2018
+ schema: external_exports.object({
2019
+ pullRequest: external_exports.object({
2020
+ url: external_exports.string(),
2021
+ number: external_exports.number(),
2022
+ title: external_exports.string(),
2023
+ body: external_exports.string()
2024
+ }).nullable()
2025
+ })
2026
+ });
2027
+ }
1902
2028
  async function disconnectAccount() {
1903
2029
  return await requestService.request({
1904
2030
  url: "core/vcs/bitbucket/disconnect-account",
@@ -1910,6 +2036,8 @@ function bitbucketApiFactory(requestService) {
1910
2036
  initiateLink,
1911
2037
  getWorkspaces,
1912
2038
  listDocsProjectBitbucketBranches,
2039
+ createDocsProjectBitbucketPullRequest,
2040
+ getDocsProjectBitbucketPullRequestForBranch,
1913
2041
  disconnectAccount
1914
2042
  };
1915
2043
  }
@@ -1991,17 +2119,6 @@ function docsProjectApiFactory(requestService) {
1991
2119
  })
1992
2120
  });
1993
2121
  }
1994
- async function getGitCredentials() {
1995
- return await requestService.request({
1996
- url: "core/forgejo/git-credentials",
1997
- method: "get",
1998
- schema: external_exports.object({
1999
- forgejoBaseUrl: external_exports.string(),
2000
- forgejoToken: external_exports.string(),
2001
- forgejoUsername: external_exports.string()
2002
- })
2003
- });
2004
- }
2005
2122
  async function updateRepoSettings(projectUid, patch) {
2006
2123
  return await requestService.request({
2007
2124
  url: "core/docs-projects/update-repo-settings",
@@ -2081,7 +2198,6 @@ function docsProjectApiFactory(requestService) {
2081
2198
  getProject,
2082
2199
  getConfig,
2083
2200
  putConfig,
2084
- getGitCredentials,
2085
2201
  updateRepoSettings,
2086
2202
  linkGithub,
2087
2203
  unlinkGithub,
@@ -2244,6 +2360,17 @@ function githubApiFactory(requestService) {
2244
2360
  }).array()
2245
2361
  });
2246
2362
  }
2363
+ async function getDocsProjectGithubCommitFiles(uid, sha) {
2364
+ return await requestService.request({
2365
+ url: `core/github/docs-project/${uid}/commits/${sha}/files`,
2366
+ method: "get",
2367
+ schema: external_exports.object({
2368
+ filepath: external_exports.string(),
2369
+ status: external_exports.enum(["added", "modified", "deleted", "renamed"]),
2370
+ previousFilepath: external_exports.string().optional()
2371
+ }).array()
2372
+ });
2373
+ }
2247
2374
  async function listDocsProjectGithubBranches(uid, opts = {}) {
2248
2375
  const params = new URLSearchParams();
2249
2376
  if (opts.query)
@@ -2398,6 +2525,7 @@ function githubApiFactory(requestService) {
2398
2525
  linkRepo,
2399
2526
  unlinkRepo,
2400
2527
  getDocsProjectGithubCommits,
2528
+ getDocsProjectGithubCommitFiles,
2401
2529
  listDocsProjectGithubBranches,
2402
2530
  createDocsProjectGithubPullRequest,
2403
2531
  getDocsProjectGithubPullRequestForBranch,
@@ -2820,6 +2948,14 @@ function teamApiFactory(requestService, getNewTokens) {
2820
2948
  schema: external_exports.null()
2821
2949
  });
2822
2950
  }
2951
+ async function createEnvironment(slug, name) {
2952
+ return await requestService.request({
2953
+ url: "core/team/environments",
2954
+ method: "post",
2955
+ data: { slug, ...name && { name } },
2956
+ schema: teamEnvironmentSchema.array()
2957
+ });
2958
+ }
2823
2959
  async function getNamespaces() {
2824
2960
  return await requestService.request({
2825
2961
  url: "core/team/namespaces",
@@ -3089,6 +3225,7 @@ function teamApiFactory(requestService, getNewTokens) {
3089
3225
  createNamespace,
3090
3226
  updateNamespace,
3091
3227
  checkNamespace,
3228
+ createEnvironment,
3092
3229
  onboardingSetup,
3093
3230
  onboardingComplete,
3094
3231
  addTeamIcon,
@@ -3110,6 +3247,7 @@ var apiServiceFactory = (baseUrl, getAuthToken, getNewTokens) => {
3110
3247
  user: userApiFactory(requestService),
3111
3248
  auth: authApiFactory(requestService),
3112
3249
  team: teamApiFactory(requestService, getNewTokens),
3250
+ teamSecrets: teamSecretsApiFactory(requestService),
3113
3251
  feedback: feedbackApiFactory(requestService),
3114
3252
  image: imageApiFactory(requestService),
3115
3253
  payment: paymentApiFactory(requestService),
@@ -3142,17 +3280,35 @@ var apiServiceFactory = (baseUrl, getAuthToken, getNewTokens) => {
3142
3280
  var apiService = async (opts) => {
3143
3281
  const auth = await getAuthData(opts);
3144
3282
  auth.addEventListener((state) => Object.assign(auth, state));
3283
+ let startedTeamUid = auth.teamUid;
3284
+ let renewal = null;
3285
+ const freshAccessToken = async () => {
3286
+ if (needsRenewal(auth.accessToken, RENEWAL_MARGIN_MS)) {
3287
+ renewal ??= renewAuth(auth).then(
3288
+ () => void 0,
3289
+ () => {
3290
+ throw new Error(SESSION_EXPIRED);
3291
+ }
3292
+ ).finally(() => {
3293
+ renewal = null;
3294
+ });
3295
+ await renewal;
3296
+ }
3297
+ if (auth.teamUid !== startedTeamUid) throw new Error(SESSION_MOVED);
3298
+ return auth.accessToken;
3299
+ };
3145
3300
  return apiServiceFactory(
3146
3301
  config.services.api,
3147
- () => auth.accessToken,
3302
+ freshAccessToken,
3148
3303
  async (teamUid) => {
3149
3304
  if ("refreshToken" in auth) {
3150
3305
  await refreshToken(auth.refreshToken, teamUid);
3151
- return;
3306
+ } else {
3307
+ await generateAccessByPersonalToken({
3308
+ personalToken: auth.personalToken
3309
+ });
3152
3310
  }
3153
- await generateAccessByPersonalToken({
3154
- personalToken: auth.personalToken
3155
- });
3311
+ startedTeamUid = auth.teamUid;
3156
3312
  }
3157
3313
  );
3158
3314
  };
@@ -1,8 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
- baseRegistrySchema,
4
- contentShaSchema
5
- } from "./chunk-MNNGUUKJ.js";
3
+ baseRegistrySchema
4
+ } from "./chunk-U764PQUA.js";
6
5
  import {
7
6
  brandedUid,
8
7
  docVersionSchema,
@@ -13,7 +12,7 @@ import {
13
12
  nanoidSchema,
14
13
  slugSchema,
15
14
  timestampSchema
16
- } from "./chunk-VVRUSQCY.js";
15
+ } from "./chunk-I57ID5K7.js";
17
16
 
18
17
  // ../../packages/entities/dist/sdk/schema.js
19
18
  var SdkLanguage;
@@ -194,6 +193,13 @@ var sdkSchema = baseRegistrySchema.extend({
194
193
  * is the latest published version's `languages`.
195
194
  */
196
195
  targets: sdkTargetSchema.array().min(1),
196
+ /**
197
+ * Bills this SDK's targets in the standard band whatever its endpoint
198
+ * count. Set on the SDKs a team already had when it moved to 2026 pricing,
199
+ * which keep that price; it does not expire and only an admin clears it.
200
+ * Unset bills by size.
201
+ */
202
+ billingBandPin: external_exports.literal("standard").nullish(),
197
203
  /**
198
204
  * @deprecated Config now lives per-version (`sdkVersionSchema.config`). Kept
199
205
  * optional for the migration/legacy path; new code reads the version config.
@@ -303,25 +309,10 @@ var sdkCodeSampleSchema = external_exports.object({
303
309
  source: external_exports.string()
304
310
  }).meta({ id: "sdk-code-sample" });
305
311
 
306
- // ../../packages/entities/dist/sdk/version.js
307
- var sdkVersionRecordSchema = entitySchema.extend({
308
- /** Own uid, branded so it cannot be confused with another entity's uid */
309
- uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
310
- version: docVersionSchema,
311
- /** The exact API version this SDK version was created against. */
312
- apiVersion: docVersionSchema,
313
- apiDocumentHash: external_exports.string().nullish(),
314
- status: sdkVersionStatusSchema,
315
- publishedAt: timestampSchema.nullish(),
316
- changeSource: external_exports.enum(["user", "api-version", "created"]).nullish(),
317
- /** SHA-256 of the config string, naming its blob under the SDK's artifacts. */
318
- configSha: contentShaSchema,
319
- languages: external_exports.enum(SdkLanguage).array(),
320
- targets: external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkVersionTargetStateSchema)
321
- }).meta({ id: "sdk-version-record" });
322
-
323
312
  export {
324
313
  SdkLanguage,
314
+ sdkVersionTargetStateSchema,
315
+ sdkVersionStatusSchema,
325
316
  sdkSchema,
326
317
  sdkBuildSchema
327
318
  };
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  safeNormalize
4
- } from "./chunk-H467HDVV.js";
4
+ } from "./chunk-PERC34BV.js";
5
5
  import {
6
6
  isUrl
7
7
  } from "./chunk-4ORL4MST.js";
@@ -23,7 +23,11 @@ var printSpecificationBanner = (result) => {
23
23
  );
24
24
  output.info().title(
25
25
  `${as.white.bold(schema?.info?.title)} ${as.grey(`(OpenAPI v${version})`)}`
26
- ).title(as.grey(`${pathsCount} paths, ${operationsCount} operations`)).print();
26
+ ).title(
27
+ as.grey(
28
+ `${pathsCount} ${pathsCount === 1 ? "path" : "paths"}, ${operationsCount} ${operationsCount === 1 ? "operation" : "operations"}`
29
+ )
30
+ ).print();
27
31
  };
28
32
 
29
33
  // src/domains/document/helpers/is-document.ts
@@ -37,12 +41,12 @@ var getFileOrUrl = async (input) => {
37
41
  if (isUrl(input)) {
38
42
  const response = await fetch(input);
39
43
  if (!response.ok) {
40
- return output.error().title("Failed to fetch from URL.").exit("error");
44
+ return output.error().title("Could not fetch the API description from the URL").exit("error");
41
45
  }
42
46
  return await response.text();
43
47
  }
44
48
  if (!fs.existsSync(input)) {
45
- return output.error().title("Could not read file.").exit("error");
49
+ return output.error().title("Could not read the API description file").exit("error");
46
50
  }
47
51
  return fs.readFileSync(input, "utf-8");
48
52
  };
@@ -50,14 +54,14 @@ var loadOpenApiDocument = async (content) => {
50
54
  try {
51
55
  const document = safeNormalize(content);
52
56
  if (!isDocument(document)) {
53
- throw new Error("Could not parse an OpenAPI document.");
57
+ throw new Error("Could not parse the OpenAPI description.");
54
58
  }
55
59
  if (isDocument(document.info) && typeof document.info.version !== "string") {
56
60
  document.info.version = "0.1.0";
57
61
  }
58
62
  const result = validate(document);
59
63
  if (!result.valid) {
60
- output.warn().title("File does not match the OpenAPI specification.").print();
64
+ output.warn().title("API description does not match the OpenAPI specification").print();
61
65
  result.errors.forEach((error) => {
62
66
  output.warn().title(
63
67
  error.path ? `${error.message} (${error.path})` : error.message
@@ -72,7 +76,7 @@ var loadOpenApiDocument = async (content) => {
72
76
  schema: result.schema
73
77
  };
74
78
  } catch (error) {
75
- output.error().title(error ? as2.red(error.toString()) : "Unknown error.").print();
79
+ output.error().title(error ? as2.red(error.toString()) : "An unexpected error occurred").print();
76
80
  const message = typeof error === "object" && error !== null && "message" in error ? String(error.message) : "Unknown error";
77
81
  return {
78
82
  valid: false,