@scalar/cli 2.5.1 → 2.7.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 (78) hide show
  1. package/README.md +113 -28
  2. package/chunks/{action-VTVFY2MP.js → action-4NGK5XMD.js} +38 -21
  3. package/chunks/{action-FDB7NEOK.js → action-5SK5NE7E.js} +10 -4
  4. package/chunks/{action-QE2ZQQX7.js → action-7PEQXDWT.js} +4 -4
  5. package/chunks/action-AQRPFQKI.js +231 -0
  6. package/chunks/{action-R7IMFHQ5.js → action-ATGZOWSH.js} +49 -26
  7. package/chunks/{action-XMNX5ZYT.js → action-BAQYJ6UE.js} +25 -21
  8. package/chunks/{action-M7RQKBSB.js → action-BOZNBCNZ.js} +89 -14
  9. package/chunks/{action-QPUSPD5M.js → action-BRSSC2SR.js} +7 -7
  10. package/chunks/{action-37EV4UHW.js → action-CA4QYPI6.js} +6 -6
  11. package/chunks/{action-JZLZ7ZAD.js → action-CPLH2CQ5.js} +17 -17
  12. package/chunks/{action-SQG3JAII.js → action-E4YSRFGT.js} +34 -20
  13. package/chunks/{action-CH24QGTE.js → action-EOAVVL52.js} +11 -5
  14. package/chunks/action-F2ZJNURT.js +72 -0
  15. package/chunks/{action-5IU77OII.js → action-F7A2K74G.js} +4 -4
  16. package/chunks/{action-SH4UUXPL.js → action-H6OUJWWM.js} +4 -4
  17. package/chunks/{action-SNLCIBQC.js → action-HJYZCPUN.js} +5 -5
  18. package/chunks/{action-LA6KVAXQ.js → action-JAHFRYWZ.js} +58 -9
  19. package/chunks/{action-UZQJNYK4.js → action-LPVITMWA.js} +3 -3
  20. package/chunks/{action-VC4DCVST.js → action-LVDU6YOI.js} +32 -23
  21. package/chunks/{action-4XI7XJR4.js → action-N7BA5I3E.js} +37 -12
  22. package/chunks/{action-NVSZT2ZD.js → action-NVI5DWFP.js} +6 -6
  23. package/chunks/{action-F3UX5E3M.js → action-OX2566BE.js} +32 -25
  24. package/chunks/{action-OGQSTRMX.js → action-QYGOPSTY.js} +13 -13
  25. package/chunks/{action-IUE4IOWO.js → action-RBOLLIGX.js} +82 -16
  26. package/chunks/{action-MSLBC2SO.js → action-SCOXTCPR.js} +15 -15
  27. package/chunks/{action-WFWYGY7O.js → action-SNPOOW6S.js} +20 -15
  28. package/chunks/{action-HGBBV353.js → action-SRBN7N3R.js} +10 -10
  29. package/chunks/{action-PAGJ5PWC.js → action-T5XMJXPO.js} +11 -7
  30. package/chunks/{action-G26LSVZ7.js → action-VOFDW3U2.js} +4 -4
  31. package/chunks/{action-FIXBOJEW.js → action-YRX6SN5F.js} +10 -4
  32. package/chunks/{agent-HCQRMHQ5.js → agent-ASPV3R5U.js} +4 -4
  33. package/chunks/{asyncapi-QM76O55R.js → asyncapi-H4FU6GPC.js} +10 -11
  34. package/chunks/{build.action-P7FCIMYU.js → build.action-6V6GXI3X.js} +35 -31
  35. package/chunks/{chunk-PT5TI77I.js → chunk-2DSVF5AD.js} +3 -3
  36. package/chunks/{chunk-X5T526CE.js → chunk-2PPRO2QB.js} +1 -1
  37. package/chunks/{chunk-Z2KMGFE6.js → chunk-4X47MN6Q.js} +2 -2
  38. package/chunks/{chunk-OQKDBLOZ.js → chunk-5JLVQVKO.js} +8 -0
  39. package/chunks/{chunk-VNYE4R7N.js → chunk-5UHLAJQD.js} +2 -1
  40. package/chunks/{chunk-Q7DOQHZN.js → chunk-6XWCMJDB.js} +1 -1
  41. package/chunks/{chunk-6ZMT63IV.js → chunk-6YPQGVF4.js} +1 -1
  42. package/chunks/{chunk-UGGNHILG.js → chunk-BDEPNGTO.js} +1 -1
  43. package/chunks/{chunk-HCPN3KNF.js → chunk-BIKOD3SG.js} +134 -1
  44. package/chunks/{chunk-P7H7GY5A.js → chunk-C2KAWRIX.js} +1 -1
  45. package/chunks/{chunk-M37TP6U2.js → chunk-CWCETP6H.js} +170 -5
  46. package/chunks/chunk-EGOXR5FB.js +15 -0
  47. package/chunks/{chunk-3L6DLIXJ.js → chunk-FDC2IESH.js} +3474 -1319
  48. package/chunks/{chunk-4ZDQXWBT.js → chunk-GPNB7ISG.js} +14 -1
  49. package/chunks/{chunk-24WAOKGG.js → chunk-HGOD6THU.js} +27 -18
  50. package/chunks/{chunk-4NHMAG6F.js → chunk-IMG35UXX.js} +1 -1
  51. package/chunks/{chunk-AO3F5XWR.js → chunk-ISXH6Q7I.js} +253 -9
  52. package/chunks/{chunk-CISTON3A.js → chunk-KCCFN4F7.js} +2 -2
  53. package/chunks/{chunk-F467BYYR.js → chunk-LG7IFACX.js} +38 -87
  54. package/chunks/{chunk-B2MHTD3R.js → chunk-MLSZVVTT.js} +1 -1
  55. package/chunks/{chunk-K4DTP5TV.js → chunk-OJ2EWIJH.js} +21 -2
  56. package/chunks/{chunk-LFU5ZUAP.js → chunk-QXQZVEDC.js} +105 -15
  57. package/chunks/{chunk-HPL3ZZ2P.js → chunk-R5LK6VPY.js} +72 -7
  58. package/chunks/{chunk-T7B6WNZC.js → chunk-TSURUX4A.js} +12 -3
  59. package/chunks/{chunk-7AGLC7WV.js → chunk-W24BETFG.js} +2 -2
  60. package/chunks/{chunk-GSGZHE26.js → chunk-XEDGMZJD.js} +19 -5
  61. package/chunks/{chunk-PBXZN65A.js → chunk-XXSQUBXS.js} +82 -6
  62. package/chunks/{chunk-XCSR4RIT.js → chunk-YILQODZF.js} +2 -2
  63. package/chunks/{chunk-COBPBRQF.js → chunk-ZJVYOZFB.js} +2 -2
  64. package/chunks/{create.action-HDD2WUON.js → create.action-P6DLCK4W.js} +27 -15
  65. package/chunks/{delete.action-VE66JFDS.js → delete.action-HJKRRHE2.js} +24 -15
  66. package/chunks/{delete.action-7GOZY7ID.js → delete.action-Z3GAA4ZN.js} +24 -15
  67. package/chunks/{get.action-2745EB4N.js → get.action-IT4EHAV4.js} +10 -10
  68. package/chunks/{list.action-4QDCZLSZ.js → list.action-2FU5UZNH.js} +15 -15
  69. package/chunks/{list.action-3VTXQJRA.js → list.action-WLIAO5UW.js} +13 -13
  70. package/chunks/{publish.action-ULQLZKWU.js → publish.action-T4J4DRXR.js} +48 -22
  71. package/chunks/{update.action-OROQSP2S.js → update.action-3OVS3HWC.js} +25 -16
  72. package/chunks/{update.action-6QEFP7NA.js → update.action-MY7QPSSU.js} +25 -16
  73. package/docs.html +294 -99
  74. package/index.js +436 -401
  75. package/package.json +15 -23
  76. package/skills/scalar-cli/SKILL.md +71 -0
  77. package/template.md +81 -3
  78. package/chunks/action-B3KKREWQ.js +0 -64
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  customProjectIconSchema
4
- } from "./chunk-OQKDBLOZ.js";
4
+ } from "./chunk-5JLVQVKO.js";
5
5
  import {
6
6
  brandedUid,
7
7
  emailSchema,
@@ -486,6 +486,7 @@ var teamPermissions = {
486
486
  };
487
487
 
488
488
  export {
489
+ TeamUserRole,
489
490
  roleSchema,
490
491
  userRefSchema,
491
492
  billingPlanSchema,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  methodSchema
4
- } from "./chunk-GSGZHE26.js";
4
+ } from "./chunk-XEDGMZJD.js";
5
5
  import {
6
6
  brandedUid,
7
7
  docVersionSchema,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  userSchema
4
- } from "./chunk-B2MHTD3R.js";
4
+ } from "./chunk-MLSZVVTT.js";
5
5
 
6
6
  // src/domains/team/helpers.ts
7
7
  var getUserTeams = async (client, email) => {
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  registryUrl
4
- } from "./chunk-COBPBRQF.js";
4
+ } from "./chunk-ZJVYOZFB.js";
5
5
 
6
6
  // src/domains/registry/helpers/fetch.ts
7
7
  async function fetchFromRegistry(path, accessToken) {
@@ -3,7 +3,7 @@ import {
3
3
  RegistryResourceTypes,
4
4
  baseRegistrySchema,
5
5
  contentShaSchema
6
- } from "./chunk-Q7DOQHZN.js";
6
+ } from "./chunk-6XWCMJDB.js";
7
7
  import {
8
8
  brandedUid,
9
9
  docVersionSchema,
@@ -210,6 +210,87 @@ var AuthDomains;
210
210
  AuthDomains2["Mcp"] = "mcp";
211
211
  })(AuthDomains || (AuthDomains = {}));
212
212
 
213
+ // ../../packages/entities/dist/publish/publish.js
214
+ var headingRecordSchema = external_exports.object({
215
+ slug: external_exports.string(),
216
+ name: external_exports.string(),
217
+ level: external_exports.coerce.number().int(),
218
+ uid: nanoidSchema,
219
+ parent: external_exports.string().optional(),
220
+ isPageTitle: external_exports.boolean().optional()
221
+ }).meta({ id: "heading-record" });
222
+ var publishAssetSchema = external_exports.object({
223
+ path: external_exports.string(),
224
+ data: external_exports.string()
225
+ }).meta({ id: "publish-asset" });
226
+ var typesenseConfigSchema = external_exports.object({
227
+ keyId: external_exports.number(),
228
+ keyValue: external_exports.string(),
229
+ collectionName: external_exports.string()
230
+ }).meta({ id: "typesense-config" });
231
+
232
+ // ../../packages/entities/dist/deploys/deploy.js
233
+ var subpathSchema = external_exports.object({
234
+ subpath: external_exports.string(),
235
+ projectUid: external_exports.string(),
236
+ /**
237
+ * The project's own title, for labelling it in cross-project search.
238
+ * Written on publish, so it is absent until the project next publishes.
239
+ */
240
+ name: external_exports.string().optional(),
241
+ /**
242
+ * The project's active publish, used to cache-bust its search index the
243
+ * way a project already busts its own. Absent until it next publishes.
244
+ */
245
+ publishUid: external_exports.string().optional(),
246
+ /**
247
+ * Present only for sites still served by Typesense. Builds on the jsonl
248
+ * search backend omit it; federated search fetches `${subpath}/search-entries.jsonl`.
249
+ */
250
+ typesenseConfig: typesenseConfigSchema.optional().nullable()
251
+ }).meta({ id: "subpath" });
252
+ var cloudflareHttpTokenSchema = external_exports.object({
253
+ /** URL path, e.g. `/.well-known/pki-validation/ca3-<id>.txt` */
254
+ path: external_exports.string(),
255
+ /** Plain-text response body the token path must answer with */
256
+ body: external_exports.string()
257
+ }).meta({ id: "cloudflare-http-token" });
258
+ var cloudflareHostnameStateSchema = external_exports.object({
259
+ /** Custom hostname id in the Cloudflare zone */
260
+ hostnameId: external_exports.string(),
261
+ /** Hostname ownership status reported by Cloudflare (pending, active, …) */
262
+ status: external_exports.string(),
263
+ /** Certificate status reported by Cloudflare (pending_validation, active, …) */
264
+ sslStatus: external_exports.string(),
265
+ httpTokens: cloudflareHttpTokenSchema.array().default([]),
266
+ /** Unix seconds of the reconciler run that last wrote this state */
267
+ syncedAt: external_exports.number()
268
+ }).meta({ id: "cloudflare-hostname-state" });
269
+ var siteDeploySchema = entitySchema.extend({
270
+ domain: external_exports.string(),
271
+ teamUid: nanoidSchema,
272
+ projectUid: nanoidSchema,
273
+ /**
274
+ * Title of the project mounted at the domain root.
275
+ *
276
+ * The root project is deliberately not one of `subpaths` — both request
277
+ * matchers resolve by longest path prefix, so a '/' entry would become a
278
+ * catch-all that every request matched. It is denormalized here instead so
279
+ * search can name and scope it without a second lookup.
280
+ */
281
+ rootName: external_exports.string().optional(),
282
+ subpaths: subpathSchema.array().default([]),
283
+ cloudflare: cloudflareHostnameStateSchema.optional().nullable()
284
+ }).meta({ id: "site-deploy" });
285
+ var searchConfigRootSchema = external_exports.object({
286
+ projectUid: external_exports.string(),
287
+ name: external_exports.string().optional()
288
+ }).meta({ id: "search-config-root" });
289
+ var searchConfigResponseSchema = external_exports.object({
290
+ subpaths: subpathSchema.array(),
291
+ root: searchConfigRootSchema.optional()
292
+ }).meta({ id: "search-config-response" });
293
+
213
294
  // ../../packages/entities/dist/login-portals/customization.js
214
295
  var loginPortalEmailSchema = external_exports.object({
215
296
  /** @deprecated No longer rendered in the email template */
@@ -291,6 +372,51 @@ var managedSchema = baseRegistrySchema.extend({
291
372
  format: managedSchemaFormat.default("json")
292
373
  }).meta({ id: "managed-schema" });
293
374
 
375
+ // ../../packages/entities/dist/mcp-server/schema.js
376
+ var mcpServerToolStates = ["enabled", "disabled"];
377
+ var mcpServerRecordSchema = baseRegistrySchema.extend({
378
+ /** Own uid, branded so it cannot be confused with another entity's uid */
379
+ uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
380
+ /** The state a tool starts in when a linked document gains an operation. */
381
+ defaultToolState: external_exports.enum(mcpServerToolStates).default("enabled"),
382
+ /** A custom domain the server is served from, when one is configured. */
383
+ domain: external_exports.string().nullable().default(null),
384
+ /**
385
+ * The Cloudflare custom hostname behind `domain`, mirrored by the edge
386
+ * cache sync. Absent until the sync has provisioned it.
387
+ */
388
+ cloudflare: cloudflareHostnameStateSchema.optional().nullable(),
389
+ /**
390
+ * When core last asked the sync to re-read the hostname from Cloudflare,
391
+ * in Unix milliseconds. The sync's own refresh schedule ends ten minutes
392
+ * after a claim, and core holds no Cloudflare credentials, so a domain
393
+ * check that finds the CNAME in place but the certificate not yet active
394
+ * stamps this for the sync to pick up.
395
+ */
396
+ domainRefreshRequestedAt: external_exports.number().nullable().optional()
397
+ }).meta({ id: "mcp-server-record" });
398
+
399
+ // ../../packages/entities/dist/mcp-server/domain.js
400
+ var mcpDomainStatuses = [
401
+ "pending",
402
+ "misconfigured",
403
+ "issuing",
404
+ "active",
405
+ "failed"
406
+ ];
407
+ var mcpDomainCheckSchema = external_exports.object({
408
+ status: external_exports.enum(mcpDomainStatuses),
409
+ /** The record the customer adds at their DNS provider. */
410
+ expected: external_exports.object({ type: external_exports.literal("CNAME"), target: external_exports.string() }),
411
+ /** What the domain resolves to today. */
412
+ found: external_exports.array(external_exports.string()),
413
+ /** The Cloudflare hostname and certificate state, once the sync has provisioned it. */
414
+ hostname: cloudflareHostnameStateSchema.pick({ status: true, sslStatus: true }).nullable()
415
+ });
416
+ var mcpServerDomainSchema = external_exports.object({
417
+ domain: external_exports.string().nullable()
418
+ });
419
+
294
420
  // ../../packages/entities/dist/repository/repository.js
295
421
  var linkedRepositoryRemoteSchema = external_exports.discriminatedUnion("provider", [
296
422
  external_exports.object({
@@ -436,6 +562,10 @@ var webhookSecretSchema = entitySchema.extend({
436
562
  expiresAt: external_exports.number()
437
563
  }).nullable().optional()
438
564
  }).meta({ id: "webhook-secret" });
565
+ var userInfoHookSecretSchema = webhookSecretSchema.extend({
566
+ uid: nanoidSchema,
567
+ teamUid: nanoidSchema
568
+ }).meta({ id: "user-info-hook-secret" });
439
569
  var webhookDeliveryStatusSchema = external_exports.enum(["pending", "succeeded", "failed"]).meta({ id: "webhook-delivery-status" });
440
570
  var webhookDeliverySchema = entitySchema.extend({
441
571
  uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
@@ -624,9 +754,12 @@ export {
624
754
  accessGroupSchema,
625
755
  identityProviders,
626
756
  identityProviderRecordSchema,
757
+ siteDeploySchema,
627
758
  loginPortalSchema,
628
759
  managedSchemaVersion,
629
760
  managedSchema,
761
+ mcpDomainCheckSchema,
762
+ mcpServerDomainSchema,
630
763
  linkedRepositorySchema,
631
764
  WaitlistProducts,
632
765
  WaitlistSources,
@@ -1,6 +1,6 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
 
3
- // ../../node_modules/.pnpm/@scalar+helpers@0.11.3/node_modules/@scalar/helpers/dist/types/result.js
3
+ // ../../node_modules/.pnpm/@scalar+helpers@0.15.0/node_modules/@scalar/helpers/dist/types/result.js
4
4
  var ok = (data) => ({ ok: true, data });
5
5
  var err = (error, message) => ({
6
6
  ok: false,
@@ -1,10 +1,11 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  config
4
- } from "./chunk-4ZDQXWBT.js";
4
+ } from "./chunk-GPNB7ISG.js";
5
5
  import {
6
+ TeamUserRole,
6
7
  roleSchema
7
- } from "./chunk-VNYE4R7N.js";
8
+ } from "./chunk-5UHLAJQD.js";
8
9
  import {
9
10
  isUrl
10
11
  } from "./chunk-4ORL4MST.js";
@@ -34,6 +35,153 @@ Visit https://nodejs.org to download the latest version.`
34
35
  }
35
36
  }
36
37
 
38
+ // ../../packages/entities/dist/oauth/scopes.js
39
+ var OAUTH_SCOPES = ["read", "write", "admin"];
40
+ var oauthScopeSchema = external_exports.enum(OAUTH_SCOPES).meta({ id: "oauth-scope" });
41
+ var roleRank = {
42
+ [TeamUserRole.Viewer]: 0,
43
+ [TeamUserRole.Editor]: 1,
44
+ [TeamUserRole.Admin]: 2,
45
+ [TeamUserRole.Owner]: 3
46
+ };
47
+ var oauthScopeRoleCeiling = {
48
+ read: TeamUserRole.Viewer,
49
+ write: TeamUserRole.Editor,
50
+ admin: TeamUserRole.Admin
51
+ };
52
+
53
+ // ../../packages/entities/dist/oauth/client.js
54
+ var oauthClientTypeSchema = external_exports.enum(["confidential", "public"]).meta({ id: "oauth-client-type" });
55
+ var oauthClientSchema = external_exports.object({
56
+ /** Doubles as the OAuth `client_id` */
57
+ uid: nanoidSchema,
58
+ teamUid: nanoidSchema,
59
+ name: external_exports.string().trim().min(1).max(100),
60
+ type: oauthClientTypeSchema,
61
+ /**
62
+ * sha256 hex digest of the client secret, confidential clients only. The
63
+ * plaintext is shown once at creation and never stored.
64
+ */
65
+ secretHash: external_exports.string().optional(),
66
+ redirectUris: external_exports.array(external_exports.string().max(2048)).min(1).max(10),
67
+ /** Scopes the client may request; the strongest sets its ceiling */
68
+ allowedScopes: external_exports.array(oauthScopeSchema).min(1),
69
+ createdBy: nanoidSchema,
70
+ createdAt: timestampSchema
71
+ }).meta({ id: "oauth-client" });
72
+ var oauthClientPublicSchema = oauthClientSchema.pick({ uid: true, name: true, type: true }).meta({ id: "oauth-client-public" });
73
+
74
+ // ../../packages/entities/dist/oauth/api.js
75
+ var oauthAuthorizeParamsSchema = external_exports.object({
76
+ client_id: external_exports.string().max(256).optional(),
77
+ redirect_uri: external_exports.string().max(2048).optional(),
78
+ response_type: external_exports.string().max(32).optional(),
79
+ scope: external_exports.string().max(256).optional(),
80
+ state: external_exports.string().max(1024).optional(),
81
+ code_challenge: external_exports.string().max(256).optional(),
82
+ code_challenge_method: external_exports.string().max(32).optional()
83
+ }).meta({ id: "oauth-authorize-params" });
84
+ var oauthAuthorizeResultSchema = external_exports.discriminatedUnion("status", [
85
+ external_exports.object({ status: external_exports.literal("ok"), uid: nanoidSchema }),
86
+ external_exports.object({
87
+ status: external_exports.literal("error"),
88
+ error: external_exports.string(),
89
+ errorDescription: external_exports.string(),
90
+ redirectTo: external_exports.string().optional()
91
+ })
92
+ ]).meta({ id: "oauth-authorize-result" });
93
+ var oauthAuthorizationRequestViewSchema = external_exports.object({
94
+ uid: nanoidSchema,
95
+ client: external_exports.object({
96
+ uid: external_exports.string(),
97
+ name: external_exports.string(),
98
+ firstParty: external_exports.boolean(),
99
+ /** Team that registered the app, absent for first-party clients */
100
+ ownerTeamName: external_exports.string().optional()
101
+ }),
102
+ scope: oauthScopeSchema,
103
+ /** Unix ms after which the request can no longer be decided */
104
+ expiresAt: external_exports.number().int()
105
+ }).meta({ id: "oauth-authorization-request-view" });
106
+ var oauthDecisionSchema = external_exports.object({ accept: external_exports.boolean() }).meta({ id: "oauth-decision" });
107
+ var oauthDecisionResultSchema = external_exports.object({ redirectTo: external_exports.string() }).meta({ id: "oauth-decision-result" });
108
+ var oauthTokenRequestSchema = external_exports.object({
109
+ grant_type: external_exports.string().max(64),
110
+ client_id: external_exports.string().max(256).optional(),
111
+ client_secret: external_exports.string().max(256).optional(),
112
+ code: external_exports.string().max(256).optional(),
113
+ redirect_uri: external_exports.string().max(2048).optional(),
114
+ code_verifier: external_exports.string().max(256).optional(),
115
+ refresh_token: external_exports.string().max(4096).optional(),
116
+ scope: external_exports.string().max(256).optional()
117
+ }).meta({ id: "oauth-token-request" });
118
+ var oauthTokenResponseSchema = external_exports.object({
119
+ access_token: external_exports.string(),
120
+ token_type: external_exports.literal("Bearer"),
121
+ /** Access token lifetime in seconds */
122
+ expires_in: external_exports.number().int(),
123
+ refresh_token: external_exports.string(),
124
+ scope: oauthScopeSchema
125
+ }).meta({ id: "oauth-token-response" });
126
+ var oauthRevokeRequestSchema = external_exports.object({
127
+ token: external_exports.string().max(4096),
128
+ token_type_hint: external_exports.string().max(64).optional(),
129
+ client_id: external_exports.string().max(256).optional(),
130
+ client_secret: external_exports.string().max(256).optional()
131
+ }).meta({ id: "oauth-revoke-request" });
132
+ var oauthErrorResponseSchema = external_exports.object({
133
+ error: external_exports.string(),
134
+ error_description: external_exports.string().optional()
135
+ }).meta({ id: "oauth-error-response" });
136
+ var oauthClientCreateSchema = external_exports.object({
137
+ name: external_exports.string().trim().min(1).max(100),
138
+ type: oauthClientTypeSchema,
139
+ redirectUris: external_exports.array(external_exports.string().trim().min(1).max(2048)).min(1).max(10),
140
+ allowedScopes: external_exports.array(oauthScopeSchema).min(1)
141
+ }).meta({ id: "oauth-client-create" });
142
+ var oauthClientListItemSchema = oauthClientSchema.omit({ secretHash: true }).meta({ id: "oauth-client-list-item" });
143
+ var oauthClientCreatedSchema = oauthClientListItemSchema.extend({ clientSecret: external_exports.string().optional() }).meta({ id: "oauth-client-created" });
144
+
145
+ // ../../packages/entities/dist/oauth/authorization.js
146
+ var codeChallengeSchema = external_exports.string().min(43).max(128);
147
+ var oauthAuthorizationRequestSchema = external_exports.object({
148
+ uid: nanoidSchema,
149
+ clientId: external_exports.string(),
150
+ redirectUri: external_exports.string(),
151
+ scope: oauthScopeSchema,
152
+ state: external_exports.string().max(1024).optional(),
153
+ codeChallenge: codeChallengeSchema,
154
+ /** Date because Mongo TTL indexes ignore numeric fields */
155
+ expiresAt: external_exports.date()
156
+ }).meta({ id: "oauth-authorization-request" });
157
+ var oauthAuthorizationCodeSchema = external_exports.object({
158
+ /** Row id only: mongobase keeps a unique `uid` index on every collection */
159
+ uid: nanoidSchema,
160
+ /** sha256 hex digest of the code; the plaintext only ever travels in the redirect */
161
+ codeHash: external_exports.string(),
162
+ clientId: external_exports.string(),
163
+ userUid: nanoidSchema,
164
+ teamUid: nanoidSchema,
165
+ redirectUri: external_exports.string(),
166
+ scope: oauthScopeSchema,
167
+ codeChallenge: codeChallengeSchema,
168
+ /**
169
+ * Whether the code has been exchanged. The `false` guard on the exchange
170
+ * write makes consumption a compare-and-set, so two racing exchanges of
171
+ * one code cannot both succeed.
172
+ */
173
+ used: external_exports.boolean(),
174
+ /** Unix ms of the exchange. A second exchange after this is a replay. */
175
+ usedAt: external_exports.number().int().optional(),
176
+ /** Refresh family issued from this code, revoked if the code is replayed */
177
+ familyId: external_exports.string().optional(),
178
+ /**
179
+ * When the code stops being exchangeable. The row outlives this (see the
180
+ * TTL index) so a late replay still revokes the family.
181
+ */
182
+ expiresAt: external_exports.date()
183
+ }).meta({ id: "oauth-authorization-code" });
184
+
37
185
  // ../../packages/entities/dist/token/token.js
38
186
  var accessTokenPayloadSchema = external_exports.object({
39
187
  userIndex: external_exports.string(),
@@ -43,6 +191,8 @@ var accessTokenPayloadSchema = external_exports.object({
43
191
  teamUid: external_exports.string().brand(),
44
192
  email: emailSchema.nullable(),
45
193
  role: roleSchema.optional(),
194
+ clientId: external_exports.string().min(1).optional(),
195
+ scope: oauthScopeSchema.optional(),
46
196
  exp: external_exports.number().int()
47
197
  }).meta({ id: "access-token-payload" });
48
198
  var healthTokenPayloadSchema = external_exports.object({
@@ -63,6 +213,8 @@ var refreshTokenPayloadSchema = external_exports.object({
63
213
  type: external_exports.string(),
64
214
  familyId: external_exports.string(),
65
215
  userIndex: external_exports.string(),
216
+ clientId: external_exports.string().min(1).optional(),
217
+ scope: oauthScopeSchema.optional(),
66
218
  exp: external_exports.number()
67
219
  }).meta({ id: "refresh-token-payload" });
68
220
  var personalTokenPayloadSchema = external_exports.object({
@@ -138,7 +290,14 @@ var refreshTokenRecordSchema = external_exports.object({
138
290
  /** family id is used to remove all tokens for a family in the event of a reuse */
139
291
  familyId: external_exports.string(),
140
292
  /** Unique lookup for the user */
141
- userIndex: external_exports.string()
293
+ userIndex: external_exports.string(),
294
+ /**
295
+ * OAuth client the family was granted to. Absent on first-party sessions;
296
+ * present, a rotation must come from the same client and re-signs the
297
+ * same scope.
298
+ */
299
+ clientId: external_exports.string().optional(),
300
+ scope: oauthScopeSchema.optional()
142
301
  }).meta({ id: "refresh-token-record" });
143
302
 
144
303
  // ../../node_modules/.pnpm/jose@5.9.6/node_modules/jose/dist/node/esm/runtime/base64url.js
@@ -385,12 +544,12 @@ var watchFile = async (file, callback, options) => {
385
544
  setInterval(callback, 5e3);
386
545
  return;
387
546
  }
388
- const absoluteFilePath = path2.join(process.cwd(), file);
547
+ const absoluteFilePath = path2.resolve(file);
389
548
  if (!fs2.existsSync(absoluteFilePath)) {
390
549
  throw new Error(`File ${absoluteFilePath} does not exist`);
391
550
  }
392
551
  output.info().title(`Watch ${file}`).print();
393
- const watcher = chokidar.watch(file, { persistent: true });
552
+ const watcher = chokidar.watch(absoluteFilePath, { persistent: true });
394
553
  watcher.on("change", () => {
395
554
  callback();
396
555
  });
@@ -431,6 +590,12 @@ var generateAccessByPersonalToken = async ({
431
590
 
432
591
  export {
433
592
  checkNodeVersion,
593
+ oauthAuthorizeResultSchema,
594
+ oauthAuthorizationRequestViewSchema,
595
+ oauthDecisionResultSchema,
596
+ oauthTokenResponseSchema,
597
+ oauthClientListItemSchema,
598
+ oauthClientCreatedSchema,
434
599
  tokenResponseSchema,
435
600
  accessTokenPayloadSchema,
436
601
  decode3 as decode,
@@ -0,0 +1,15 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ output
4
+ } from "./chunk-T5HJUAWB.js";
5
+
6
+ // src/helpers/interactive.ts
7
+ function requireInteractive(message) {
8
+ if (!process.stdin.isTTY) {
9
+ output.error().title("Missing input").message(message).exit("error");
10
+ }
11
+ }
12
+
13
+ export {
14
+ requireInteractive
15
+ };