@scalar/cli 2.1.0 → 2.5.2

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 (88) hide show
  1. package/README.md +28 -24
  2. package/chunks/action-42D2C47G.js +18 -0
  3. package/chunks/{action-DFKHSDFV.js → action-6FAJNP6C.js} +7 -3
  4. package/chunks/{action-5R5FDF6S.js → action-6MZZHPVQ.js} +120 -22
  5. package/chunks/{action-BYZUBXVB.js → action-7H3XARJP.js} +8 -4
  6. package/chunks/{action-H5OHT2GV.js → action-AMNYOA4B.js} +7 -3
  7. package/chunks/{action-ANU5HGC4.js → action-DCINFQ57.js} +17 -14
  8. package/chunks/{action-GB6DM53B.js → action-DGD6Q6Y5.js} +21 -10
  9. package/chunks/{action-TPBKPHNS.js → action-EPNE5XCM.js} +22 -22
  10. package/chunks/{action-C5VB4ITT.js → action-FF2OMGAS.js} +36 -18
  11. package/chunks/{action-Q5UJ32D6.js → action-H3RTILLM.js} +1 -1
  12. package/chunks/action-HIL5ZFNB.js +84 -0
  13. package/chunks/{action-MENXFJH3.js → action-HXHBU7XC.js} +9 -9
  14. package/chunks/{action-F4Y6Q2VB.js → action-LFL3ZZKN.js} +21 -21
  15. package/chunks/action-LUVBQEIQ.js +250 -0
  16. package/chunks/{action-TZ5KGAQT.js → action-OILGZAMK.js} +17 -14
  17. package/chunks/{action-HD2T6BFJ.js → action-OK55BFGM.js} +10 -10
  18. package/chunks/{action-HNKM3Q65.js → action-P7RFXIC7.js} +17 -14
  19. package/chunks/action-PAA4NWUJ.js +374 -0
  20. package/chunks/action-PHLOE27S.js +522 -0
  21. package/chunks/{action-CYP4VDK3.js → action-RBVPKCRI.js} +12 -35
  22. package/chunks/action-SJYAMXYI.js +244 -0
  23. package/chunks/{action-45OGQB2M.js → action-TWHLZW4V.js} +17 -8
  24. package/chunks/{action-GEBRPNRT.js → action-V5KYG7XD.js} +15 -16
  25. package/chunks/{action-BNEGJBUH.js → action-W62AIEBN.js} +8 -9
  26. package/chunks/{action-PVDDRIM6.js → action-X7TZA3RE.js} +65 -26
  27. package/chunks/{action-CLSD7O2R.js → action-XUQ7TKKJ.js} +10 -10
  28. package/chunks/{action-BMFXENMX.js → action-Y6CEKYEK.js} +39 -34
  29. package/chunks/{action-STIEAXOE.js → action-YRWHX2AE.js} +16 -5
  30. package/chunks/{action-W5BATF4Q.js → action-ZLTUMRO2.js} +24 -24
  31. package/chunks/{action-UDZUUJSI.js → action-ZWQLQENM.js} +18 -7
  32. package/chunks/{agent-XGLOHXNA.js → agent-JAXLLDPE.js} +25 -5
  33. package/chunks/asyncapi-P6Y3L7RG.js +105 -0
  34. package/chunks/{build.action-LKOILPA6.js → build.action-AZ5ECU4B.js} +22 -22
  35. package/chunks/chunk-3BWGTPPT.js +27022 -0
  36. package/chunks/{chunk-ZTVWAKNJ.js → chunk-3DJ2GKEG.js} +1 -1
  37. package/chunks/chunk-3ZJYGGAA.js +30 -0
  38. package/chunks/{chunk-IX7LJ3AD.js → chunk-4ORL4MST.js} +2 -3
  39. package/chunks/{chunk-ASMHW5AY.js → chunk-6ZMT63IV.js} +1 -1
  40. package/chunks/{chunk-B6QZJWCQ.js → chunk-B2MHTD3R.js} +4 -6
  41. package/chunks/{chunk-P646T2WH.js → chunk-CIFOFSZ3.js} +131 -13
  42. package/chunks/chunk-CX7ZRMTC.js +404 -0
  43. package/chunks/{chunk-HQKBZOYU.js → chunk-FOKFF4EP.js} +3 -3
  44. package/chunks/{chunk-UPUTMFD4.js → chunk-FQVVKQPU.js} +185 -13
  45. package/chunks/{chunk-P2VH7DOC.js → chunk-HUCR333E.js} +6 -6
  46. package/chunks/{chunk-KWOL7A6J.js → chunk-HXIDUCSZ.js} +2 -2
  47. package/chunks/{chunk-H2WRMLYY.js → chunk-IKT5F47M.js} +3571 -7
  48. package/chunks/{chunk-OAXFCOJV.js → chunk-JV7TUEXQ.js} +2 -1
  49. package/chunks/{chunk-2BSG2QHO.js → chunk-KEOCJ3NJ.js} +133 -20
  50. package/chunks/{chunk-AHWWJ3MD.js → chunk-LCPFHE4Z.js} +1 -1
  51. package/chunks/{chunk-TLFMATXR.js → chunk-LQN4S62O.js} +33 -25
  52. package/chunks/chunk-M622VXRQ.js +14 -0
  53. package/chunks/chunk-M6Q3ARBV.js +210 -0
  54. package/chunks/{chunk-4QS7SJTG.js → chunk-MNLXYOVF.js} +51 -36
  55. package/chunks/{chunk-5BISXQX4.js → chunk-NIXG4KDE.js} +11 -13
  56. package/chunks/{chunk-47Y4L5IT.js → chunk-NNMSZVAB.js} +1031 -481
  57. package/chunks/chunk-OQKDBLOZ.js +741 -0
  58. package/chunks/{chunk-NUXPNUSS.js → chunk-RAO7VUGM.js} +1 -1
  59. package/chunks/{chunk-SHSHFGA7.js → chunk-RPVHJMQT.js} +4 -6
  60. package/chunks/{chunk-23I5PKZZ.js → chunk-SWWWYWHC.js} +32 -5
  61. package/chunks/{chunk-X4QLDBB5.js → chunk-T5HJUAWB.js} +24 -3
  62. package/chunks/chunk-TYLWJ2UL.js +25 -0
  63. package/chunks/{chunk-SXYALPYK.js → chunk-UB3XGOUW.js} +498 -60
  64. package/chunks/{chunk-TQ5XC2E3.js → chunk-UMPODUJO.js} +77 -11
  65. package/chunks/{chunk-4DGQIAJX.js → chunk-VNYE4R7N.js} +154 -14
  66. package/chunks/{create.action-FFQLBSJH.js → create.action-34OTO2SB.js} +22 -22
  67. package/chunks/{delete.action-QNN3LC2F.js → delete.action-6LRT4M3S.js} +22 -22
  68. package/chunks/{delete.action-STHQHP4F.js → delete.action-ZYXFMIOW.js} +22 -22
  69. package/chunks/{get.action-OTKYOP3Z.js → get.action-XP36SA2J.js} +15 -16
  70. package/chunks/{list.action-KDM5RHEH.js → list.action-6LF6KSD5.js} +19 -19
  71. package/chunks/{list.action-6I5EZAVB.js → list.action-WVRVLX5E.js} +22 -22
  72. package/chunks/{publish.action-PODTVRXS.js → publish.action-AHFUBT5C.js} +44 -36
  73. package/chunks/{update.action-KMD4ZM75.js → update.action-YQTVUDYE.js} +22 -22
  74. package/chunks/{update.action-4F6STTEQ.js → update.action-ZREAFJVG.js} +22 -22
  75. package/docs.html +107 -104
  76. package/index.js +84 -68
  77. package/package.json +19 -15
  78. package/chunks/action-CCW66QJN.js +0 -72
  79. package/chunks/action-CQ56FVES.js +0 -65
  80. package/chunks/action-JOSVV6YA.js +0 -71
  81. package/chunks/action-P7LN6FGY.js +0 -13
  82. package/chunks/action-R6ZZO26F.js +0 -299
  83. package/chunks/action-TWFJNQ2R.js +0 -95
  84. package/chunks/chunk-5BPPGTUU.js +0 -463
  85. package/chunks/chunk-DOVIWNKQ.js +0 -108
  86. package/chunks/chunk-ISGLWBXZ.js +0 -4265
  87. package/chunks/chunk-T7MDADON.js +0 -17
  88. package/chunks/chunk-VTYTPSXO.js +0 -161
@@ -1,20 +1,19 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
- baseRegistrySchema
4
- } from "./chunk-VTYTPSXO.js";
3
+ baseRegistrySchema,
4
+ docVersionToolSchema
5
+ } from "./chunk-CX7ZRMTC.js";
5
6
  import {
6
- methodSchema
7
- } from "./chunk-TLFMATXR.js";
7
+ HTTP_METHODS
8
+ } from "./chunk-LQN4S62O.js";
8
9
  import {
9
10
  brandedUid,
10
11
  compareVersionsDesc,
11
12
  docVersionSchema,
13
+ external_exports,
12
14
  mintUid,
13
15
  nanoidSchema
14
- } from "./chunk-ISGLWBXZ.js";
15
- import {
16
- external_exports
17
- } from "./chunk-H2WRMLYY.js";
16
+ } from "./chunk-IKT5F47M.js";
18
17
 
19
18
  // ../../packages/entities/dist/rule/default-data.js
20
19
  var scalarRuleset = `extends: spectral:oas
@@ -46,11 +45,7 @@ var ApiEmbedStatus;
46
45
  ApiEmbedStatus2["Complete"] = "complete";
47
46
  ApiEmbedStatus2["Failed"] = "failed";
48
47
  })(ApiEmbedStatus || (ApiEmbedStatus = {}));
49
- var managedDocTool = external_exports.object({
50
- path: external_exports.string(),
51
- method: methodSchema,
52
- enabledTools: external_exports.enum(["execute-request", "get-mini-openapi-spec"]).array()
53
- });
48
+ var managedDocTool = docVersionToolSchema;
54
49
  var managedDocVersionSchema = external_exports.object({
55
50
  uid: nanoidSchema,
56
51
  /** Millisecond base timestamp of versions */
@@ -58,28 +53,47 @@ var managedDocVersionSchema = external_exports.object({
58
53
  version: docVersionSchema,
59
54
  /** OpenAPI version normalized on upload */
60
55
  upgraded: external_exports.boolean().default(false),
56
+ /** Endpoints (path + method pairs) counted at ingest; null when unknown */
57
+ endpointCount: external_exports.number().int().nullable().default(null),
61
58
  /** Vector embeddings processed, agent is enabled */
62
59
  embedStatus: external_exports.enum(ApiEmbedStatus).nullable().default(null),
63
60
  tags: external_exports.string().array().default([]),
64
61
  tools: managedDocTool.array().optional(),
65
- /** SHA-256 hex digest of the YAML content stored in the registry bucket */
62
+ /** SHA-256 hex digest of the YAML content the version serves (from its chain head) */
66
63
  yamlSha: external_exports.string().optional(),
67
- /** SHA-256 hex digest of the JSON content stored in the registry bucket */
68
- jsonSha: external_exports.string().optional(),
69
- /** Random opaque token regenerated whenever the version's content changes */
70
- versionSha: external_exports.string().optional()
64
+ /** SHA-256 hex digest of the JSON content the version serves (from its chain head) */
65
+ jsonSha: external_exports.string().optional()
71
66
  }).meta({ id: "managed-doc-version" });
67
+ var managedDocTypeSchema = external_exports.enum(["openapi", "asyncapi"]);
72
68
  var managedDocSchema = baseRegistrySchema.extend({
73
69
  /** Own uid, branded so it cannot be confused with another entity's uid */
74
70
  uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
75
71
  /** The current version served to consumers by default */
76
72
  version: docVersionSchema,
77
73
  /**
78
- * Certain types of collections will be write restricted for properties
79
- * that would mutate the original specification (such as adding endpoints)
74
+ * Whether the document is an OpenAPI or AsyncAPI description, detected from
75
+ * the document content on upload. Defaults to 'openapi' so records created
76
+ * before this field existed parse as OpenAPI, matching the registry's
77
+ * original OpenAPI-only behavior.
78
+ */
79
+ type: managedDocTypeSchema.default("openapi"),
80
+ /** Initial upload format, used as the editor default. Absent on older APIs. */
81
+ sourceFormat: external_exports.enum(["json", "yaml"]).optional(),
82
+ /**
83
+ * Denormalized highest-ranked version label, maintained at ingest so
84
+ * `latest` resolution and list views never re-sort the versions collection.
85
+ * Absent until the document goes through the instance-based ingest path.
86
+ */
87
+ latestVersion: docVersionSchema.optional(),
88
+ /**
89
+ * @deprecated Never read anywhere — superseded by `source` on the base
90
+ * registry schema. Dropped at decommission.
80
91
  */
81
92
  isExternal: external_exports.boolean().default(true),
82
- /** Repository information if we are managing a github spec */
93
+ /**
94
+ * @deprecated Never read anywhere — superseded by `source` with
95
+ * `type: 'git'`. Dropped at decommission.
96
+ */
83
97
  repository: external_exports.object({
84
98
  linkedBy: external_exports.string(),
85
99
  id: external_exports.number(),
@@ -87,28 +101,19 @@ var managedDocSchema = baseRegistrySchema.extend({
87
101
  path: external_exports.string().default(""),
88
102
  branch: external_exports.string().default("")
89
103
  }).optional(),
90
- /** URL to the source spec if we are managing a hosted spec */
104
+ /**
105
+ * @deprecated Never read anywhere — superseded by `source` with
106
+ * `type: 'url'`. Dropped at decommission.
107
+ */
91
108
  sourceUrl: external_exports.url().optional(),
92
109
  /** Theme assigned to API, supports custom theme slugs */
93
110
  theme: external_exports.string().default(""),
94
111
  /**
95
- * UID to the collaborative YJS doc
96
- *
97
- * This content will be replaced on submitted updates and able to be edited in real-time
98
- * When a user is ready to commit their changes they can bump the version with the changed content
112
+ * @deprecated The collaborative YJS doc it pointed at was never built —
113
+ * no consumer exists anywhere. Dropped at decommission.
99
114
  */
100
115
  editableUid: external_exports.string(),
101
116
  ruleset: external_exports.string().default(scalarRuleset),
102
- /**
103
- * An ordered version history record
104
- *
105
- * When a sync update is requested we find any versions with timestamps
106
- * later than the local base and determine the mutation records
107
- *
108
- * Mutations records will then need to be diffed and conflicts handled locally
109
- * before pushing to the database
110
- */
111
- versions: managedDocVersionSchema.array(),
112
117
  /** Enable Agent Scalar */
113
118
  agentEnabled: external_exports.boolean().default(true),
114
119
  /**
@@ -120,7 +125,16 @@ var managedDocSchema = baseRegistrySchema.extend({
120
125
  verified: external_exports.boolean().default(false)
121
126
  }).meta({ id: "managed-doc" });
122
127
 
128
+ // ../../packages/entities/dist/managed-doc/count-endpoints.js
129
+ var MAX_OPERATIONS_PER_PATH_ITEM = HTTP_METHODS.length;
130
+
123
131
  // ../../packages/entities/dist/managed-doc/helpers.js
132
+ function detectManagedDocType(document) {
133
+ if (typeof document === "object" && document !== null && "asyncapi" in document) {
134
+ return "asyncapi";
135
+ }
136
+ return "openapi";
137
+ }
124
138
  function getLegacyWysiwygVersion(versions) {
125
139
  if (versions.includes("latest")) {
126
140
  return "latest";
@@ -131,6 +145,7 @@ function getLegacyWysiwygVersion(versions) {
131
145
 
132
146
  export {
133
147
  ruleSchema,
148
+ detectManagedDocType,
134
149
  getLegacyWysiwygVersion,
135
150
  RegistryAsset,
136
151
  managedDocVersionSchema,
@@ -1,26 +1,24 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  config
4
- } from "./chunk-OAXFCOJV.js";
4
+ } from "./chunk-JV7TUEXQ.js";
5
5
  import {
6
6
  roleSchema
7
- } from "./chunk-4DGQIAJX.js";
7
+ } from "./chunk-VNYE4R7N.js";
8
+ import {
9
+ isUrl
10
+ } from "./chunk-4ORL4MST.js";
11
+ import {
12
+ output
13
+ } from "./chunk-T5HJUAWB.js";
8
14
  import {
9
15
  emailSchema,
10
16
  entitySchema,
11
- nanoidSchema,
12
- timestampSchema
13
- } from "./chunk-ISGLWBXZ.js";
14
- import {
15
17
  external_exports,
18
+ nanoidSchema,
19
+ timestampSchema,
16
20
  zod_default
17
- } from "./chunk-H2WRMLYY.js";
18
- import {
19
- isUrl
20
- } from "./chunk-IX7LJ3AD.js";
21
- import {
22
- output
23
- } from "./chunk-X4QLDBB5.js";
21
+ } from "./chunk-IKT5F47M.js";
24
22
 
25
23
  // src/helpers/node-version.ts
26
24
  import semver from "semver";