@scalar/cli 2.0.1 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +68 -24
  2. package/chunks/action-37EV4UHW.js +125 -0
  3. package/chunks/action-4XI7XJR4.js +204 -0
  4. package/chunks/action-5IU77OII.js +60 -0
  5. package/chunks/action-B3KKREWQ.js +64 -0
  6. package/chunks/action-CH24QGTE.js +86 -0
  7. package/chunks/action-F3UX5E3M.js +522 -0
  8. package/chunks/action-FDB7NEOK.js +81 -0
  9. package/chunks/action-FIXBOJEW.js +244 -0
  10. package/chunks/action-G26LSVZ7.js +40 -0
  11. package/chunks/action-H3RTILLM.js +46 -0
  12. package/chunks/action-HGBBV353.js +86 -0
  13. package/chunks/action-IUE4IOWO.js +2142 -0
  14. package/chunks/action-JZLZ7ZAD.js +110 -0
  15. package/chunks/action-LA6KVAXQ.js +374 -0
  16. package/chunks/action-M7RQKBSB.js +169 -0
  17. package/chunks/action-MSLBC2SO.js +92 -0
  18. package/chunks/action-NVSZT2ZD.js +37 -0
  19. package/chunks/action-OGQSTRMX.js +37 -0
  20. package/chunks/action-PAGJ5PWC.js +60 -0
  21. package/chunks/action-QE2ZQQX7.js +250 -0
  22. package/chunks/action-QPUSPD5M.js +54 -0
  23. package/chunks/action-R7IMFHQ5.js +147 -0
  24. package/chunks/action-SH4UUXPL.js +60 -0
  25. package/chunks/action-SNLCIBQC.js +84 -0
  26. package/chunks/action-SQG3JAII.js +150 -0
  27. package/chunks/action-UZQJNYK4.js +18 -0
  28. package/chunks/action-VC4DCVST.js +68 -0
  29. package/chunks/action-VTVFY2MP.js +181 -0
  30. package/chunks/action-WFWYGY7O.js +67 -0
  31. package/chunks/action-XMNX5ZYT.js +197 -0
  32. package/chunks/agent-HCQRMHQ5.js +132 -0
  33. package/chunks/asyncapi-QM76O55R.js +105 -0
  34. package/chunks/build.action-P7FCIMYU.js +108 -0
  35. package/chunks/chunk-24WAOKGG.js +105 -0
  36. package/chunks/chunk-3L6DLIXJ.js +25530 -0
  37. package/chunks/chunk-3MZYUBJ6.js +49 -0
  38. package/chunks/chunk-3ZJYGGAA.js +30 -0
  39. package/chunks/chunk-4NHMAG6F.js +21 -0
  40. package/chunks/chunk-4ORL4MST.js +16 -0
  41. package/chunks/chunk-4ZDQXWBT.js +26 -0
  42. package/chunks/chunk-6ZMT63IV.js +19 -0
  43. package/chunks/chunk-7AGLC7WV.js +107 -0
  44. package/chunks/chunk-AEFPCC4U.js +16 -0
  45. package/chunks/chunk-AO3F5XWR.js +3147 -0
  46. package/chunks/chunk-B2MHTD3R.js +90 -0
  47. package/chunks/chunk-CISTON3A.js +153 -0
  48. package/chunks/chunk-COBPBRQF.js +25 -0
  49. package/chunks/chunk-F467BYYR.js +568 -0
  50. package/chunks/chunk-GSGZHE26.js +352 -0
  51. package/chunks/chunk-HCPN3KNF.js +637 -0
  52. package/chunks/chunk-HPL3ZZ2P.js +1726 -0
  53. package/chunks/chunk-IKT5F47M.js +17344 -0
  54. package/chunks/chunk-JFIXNSPP.js +26 -0
  55. package/chunks/chunk-K4DTP5TV.js +32 -0
  56. package/chunks/chunk-K74E42RV.js +7311 -0
  57. package/chunks/chunk-KHDYYVYF.js +16 -0
  58. package/chunks/chunk-LFU5ZUAP.js +350 -0
  59. package/chunks/chunk-M37TP6U2.js +445 -0
  60. package/chunks/chunk-OQKDBLOZ.js +741 -0
  61. package/chunks/chunk-P7H7GY5A.js +14 -0
  62. package/chunks/chunk-PBXZN65A.js +63911 -0
  63. package/chunks/chunk-PT5TI77I.js +34 -0
  64. package/chunks/chunk-Q7DOQHZN.js +404 -0
  65. package/chunks/chunk-T5HJUAWB.js +242 -0
  66. package/chunks/chunk-T7B6WNZC.js +18 -0
  67. package/chunks/chunk-UGGNHILG.js +38 -0
  68. package/chunks/chunk-VNYE4R7N.js +499 -0
  69. package/chunks/chunk-X5T526CE.js +23 -0
  70. package/chunks/chunk-XCSR4RIT.js +210 -0
  71. package/chunks/chunk-Z2KMGFE6.js +295 -0
  72. package/chunks/create.action-HDD2WUON.js +108 -0
  73. package/chunks/delete.action-7GOZY7ID.js +88 -0
  74. package/chunks/delete.action-VE66JFDS.js +96 -0
  75. package/chunks/get.action-2745EB4N.js +86 -0
  76. package/chunks/list.action-3VTXQJRA.js +116 -0
  77. package/chunks/list.action-4QDCZLSZ.js +95 -0
  78. package/chunks/publish.action-ULQLZKWU.js +190 -0
  79. package/chunks/update.action-6QEFP7NA.js +95 -0
  80. package/chunks/update.action-OROQSP2S.js +101 -0
  81. package/docs.html +352 -250
  82. package/index.js +664 -99064
  83. package/package.json +17 -11
@@ -0,0 +1,90 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ teamImageSchema,
4
+ teamNameSchema
5
+ } from "./chunk-VNYE4R7N.js";
6
+ import {
7
+ brandedUid,
8
+ emailSchema,
9
+ entitySchema,
10
+ external_exports,
11
+ mintUid,
12
+ timestampSchema,
13
+ zod_default
14
+ } from "./chunk-IKT5F47M.js";
15
+
16
+ // ../../packages/entities/dist/user/bitbucket.js
17
+ var userBitbucketSchema = entitySchema.extend({
18
+ token: zod_default.string(),
19
+ refreshToken: zod_default.string(),
20
+ expiry: timestampSchema,
21
+ refreshExpiry: timestampSchema
22
+ }).meta({ id: "user-bitbucket" });
23
+
24
+ // ../../packages/entities/dist/user/github.js
25
+ var userGithubSchema = entitySchema.extend({
26
+ token: zod_default.string(),
27
+ refreshToken: zod_default.string(),
28
+ expiry: timestampSchema,
29
+ refreshExpiry: timestampSchema
30
+ }).meta({ id: "user-github" });
31
+
32
+ // ../../packages/entities/dist/user/password.js
33
+ var userPasswordSchema = entitySchema.extend({
34
+ passwordHash: external_exports.string().nullable().default(null),
35
+ salt: external_exports.string().nullable().default(null),
36
+ password: external_exports.string().nullable().default(null),
37
+ passwordDeprecatedExp: external_exports.number().nullable().default(null)
38
+ }).overwrite((d) => {
39
+ if (d.passwordHash) {
40
+ d.password = null;
41
+ d.salt = null;
42
+ d.passwordDeprecatedExp = null;
43
+ }
44
+ return d;
45
+ }).meta({ id: "user-password" });
46
+ var emailSignupOtpSchema = entitySchema.extend({
47
+ email: emailSchema,
48
+ otp: external_exports.string().min(6).max(6),
49
+ otpClientId: external_exports.string(),
50
+ exp: timestampSchema
51
+ }).meta({ id: "email-signup-otp" });
52
+
53
+ // ../../packages/entities/dist/user/signup-meta.js
54
+ var signupMetaSchema = entitySchema.extend({
55
+ email: zod_default.string().optional(),
56
+ ip: zod_default.string().optional(),
57
+ region: zod_default.string().optional(),
58
+ city: zod_default.string().optional(),
59
+ location: zod_default.string().optional()
60
+ }).meta({ id: "signup-meta" });
61
+
62
+ // ../../packages/entities/dist/user/user.js
63
+ var teamRefSchema = zod_default.object({
64
+ // Brand only — keeps the runtime `z.string()` validation while flowing the
65
+ // Team brand into Team-scoped accessors.
66
+ teamUid: zod_default.string().brand(),
67
+ teamName: teamNameSchema,
68
+ teamImageUri: teamImageSchema
69
+ }).meta({ id: "team-ref" });
70
+ var userSchema = entitySchema.extend({
71
+ /** Own uid, branded so it cannot be confused with another entity's uid */
72
+ uid: brandedUid().default(mintUid).meta({
73
+ default: "nanoid()"
74
+ }),
75
+ theme: zod_default.string().optional(),
76
+ /** Email or other unique token identifier for performant auth lookup */
77
+ userIndex: zod_default.string().overwrite((s) => s.toLowerCase()),
78
+ /** Federated auth provided must have a linked email */
79
+ email: emailSchema,
80
+ teams: teamRefSchema.array(),
81
+ activeTeamId: zod_default.string().brand().nullable(),
82
+ hasGithub: zod_default.boolean().optional().default(false),
83
+ hasBitbucket: zod_default.boolean().optional().default(false),
84
+ /** Forgejo personal access token for git operations */
85
+ forgejoToken: zod_default.string().optional()
86
+ }).meta({ id: "user" });
87
+
88
+ export {
89
+ userSchema
90
+ };
@@ -0,0 +1,153 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ baseRegistrySchema,
4
+ docVersionToolSchema
5
+ } from "./chunk-Q7DOQHZN.js";
6
+ import {
7
+ HTTP_METHODS
8
+ } from "./chunk-GSGZHE26.js";
9
+ import {
10
+ brandedUid,
11
+ compareVersionsDesc,
12
+ docVersionSchema,
13
+ external_exports,
14
+ mintUid,
15
+ nanoidSchema
16
+ } from "./chunk-IKT5F47M.js";
17
+
18
+ // ../../packages/entities/dist/rule/default-data.js
19
+ var scalarRuleset = `extends: spectral:oas
20
+ rules: {}`;
21
+
22
+ // ../../packages/entities/dist/rule/schema.js
23
+ var blockPublishOnSchema = external_exports.enum([
24
+ "error",
25
+ "warning",
26
+ "info",
27
+ "hint",
28
+ "none"
29
+ ]);
30
+ var ruleSchema = baseRegistrySchema.extend({
31
+ blockPublishOn: blockPublishOnSchema.default("none")
32
+ }).meta({ id: "rule" });
33
+
34
+ // ../../packages/entities/dist/managed-doc/managed-doc.js
35
+ var RegistryAsset;
36
+ (function(RegistryAsset2) {
37
+ RegistryAsset2["Apis"] = "apis";
38
+ RegistryAsset2["Rules"] = "rules";
39
+ RegistryAsset2["Sdks"] = "sdks";
40
+ RegistryAsset2["Schemas"] = "schemas";
41
+ RegistryAsset2["Workspaces"] = "workspaces";
42
+ })(RegistryAsset || (RegistryAsset = {}));
43
+ var ApiEmbedStatus;
44
+ (function(ApiEmbedStatus2) {
45
+ ApiEmbedStatus2["Complete"] = "complete";
46
+ ApiEmbedStatus2["Failed"] = "failed";
47
+ })(ApiEmbedStatus || (ApiEmbedStatus = {}));
48
+ var managedDocTool = docVersionToolSchema;
49
+ var managedDocVersionSchema = external_exports.object({
50
+ uid: nanoidSchema,
51
+ /** Millisecond base timestamp of versions */
52
+ createdAt: external_exports.number(),
53
+ version: docVersionSchema,
54
+ /** OpenAPI version normalized on upload */
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),
58
+ /** Vector embeddings processed, agent is enabled */
59
+ embedStatus: external_exports.enum(ApiEmbedStatus).nullable().default(null),
60
+ tags: external_exports.string().array().default([]),
61
+ tools: managedDocTool.array().optional(),
62
+ /** SHA-256 hex digest of the YAML content the version serves (from its chain head) */
63
+ yamlSha: 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()
66
+ }).meta({ id: "managed-doc-version" });
67
+ var managedDocTypeSchema = external_exports.enum(["openapi", "asyncapi"]);
68
+ var managedDocSchema = baseRegistrySchema.extend({
69
+ /** Own uid, branded so it cannot be confused with another entity's uid */
70
+ uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
71
+ /** The current version served to consumers by default */
72
+ version: docVersionSchema,
73
+ /**
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.
91
+ */
92
+ isExternal: external_exports.boolean().default(true),
93
+ /**
94
+ * @deprecated Never read anywhere — superseded by `source` with
95
+ * `type: 'git'`. Dropped at decommission.
96
+ */
97
+ repository: external_exports.object({
98
+ linkedBy: external_exports.string(),
99
+ id: external_exports.number(),
100
+ name: external_exports.string().min(2),
101
+ path: external_exports.string().default(""),
102
+ branch: external_exports.string().default("")
103
+ }).optional(),
104
+ /**
105
+ * @deprecated Never read anywhere — superseded by `source` with
106
+ * `type: 'url'`. Dropped at decommission.
107
+ */
108
+ sourceUrl: external_exports.url().optional(),
109
+ /** Theme assigned to API, supports custom theme slugs */
110
+ theme: external_exports.string().default(""),
111
+ /**
112
+ * @deprecated The collaborative YJS doc it pointed at was never built —
113
+ * no consumer exists anywhere. Dropped at decommission.
114
+ */
115
+ editableUid: external_exports.string(),
116
+ ruleset: external_exports.string().default(scalarRuleset),
117
+ /** Enable Agent Scalar */
118
+ agentEnabled: external_exports.boolean().default(true),
119
+ /**
120
+ * Scalar verified status
121
+ *
122
+ * This will be moved in the future to a separate
123
+ * collection for registry DNS checks.
124
+ */
125
+ verified: external_exports.boolean().default(false)
126
+ }).meta({ id: "managed-doc" });
127
+
128
+ // ../../packages/entities/dist/managed-doc/count-endpoints.js
129
+ var MAX_OPERATIONS_PER_PATH_ITEM = HTTP_METHODS.length;
130
+
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
+ }
138
+ function getLegacyWysiwygVersion(versions) {
139
+ if (versions.includes("latest")) {
140
+ return "latest";
141
+ }
142
+ const latestVersion = [...versions].sort((a, b) => compareVersionsDesc(a, b))[0];
143
+ return latestVersion ?? "latest";
144
+ }
145
+
146
+ export {
147
+ ruleSchema,
148
+ detectManagedDocType,
149
+ getLegacyWysiwygVersion,
150
+ RegistryAsset,
151
+ managedDocVersionSchema,
152
+ managedDocSchema
153
+ };
@@ -0,0 +1,25 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ config
4
+ } from "./chunk-4ZDQXWBT.js";
5
+ import {
6
+ RegistryAsset
7
+ } from "./chunk-CISTON3A.js";
8
+
9
+ // src/domains/registry/helpers/links.ts
10
+ function registryUrl(path) {
11
+ return `${config.projects.registry}/${path}`;
12
+ }
13
+ var DASHBOARD_ASSET_PATHS = {
14
+ [RegistryAsset.Apis]: (uid) => `apis/${uid}`,
15
+ [RegistryAsset.Schemas]: (uid) => `apis/schemas/${uid}`,
16
+ [RegistryAsset.Rules]: (uid) => `apis/rulesets/${uid}`
17
+ };
18
+ function dashboardUrl(asset, uid) {
19
+ return `${config.projects.dashboard}/${DASHBOARD_ASSET_PATHS[asset]?.(uid) ?? "apis"}`;
20
+ }
21
+
22
+ export {
23
+ registryUrl,
24
+ dashboardUrl
25
+ };