@scalar/cli 2.5.2 → 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.
- package/README.md +113 -28
- package/chunks/{action-Y6CEKYEK.js → action-4NGK5XMD.js} +38 -21
- package/chunks/{action-DGD6Q6Y5.js → action-5SK5NE7E.js} +10 -4
- package/chunks/{action-LUVBQEIQ.js → action-7PEQXDWT.js} +4 -4
- package/chunks/action-AQRPFQKI.js +231 -0
- package/chunks/{action-TWHLZW4V.js → action-ATGZOWSH.js} +49 -26
- package/chunks/{action-ZLTUMRO2.js → action-BAQYJ6UE.js} +25 -21
- package/chunks/{action-X7TZA3RE.js → action-BOZNBCNZ.js} +89 -14
- package/chunks/{action-OK55BFGM.js → action-BRSSC2SR.js} +7 -7
- package/chunks/{action-RBVPKCRI.js → action-CA4QYPI6.js} +6 -6
- package/chunks/{action-EPNE5XCM.js → action-CPLH2CQ5.js} +17 -17
- package/chunks/{action-FF2OMGAS.js → action-E4YSRFGT.js} +34 -20
- package/chunks/{action-7H3XARJP.js → action-EOAVVL52.js} +11 -5
- package/chunks/action-F2ZJNURT.js +72 -0
- package/chunks/{action-AMNYOA4B.js → action-F7A2K74G.js} +4 -4
- package/chunks/{action-ZWQLQENM.js → action-H6OUJWWM.js} +4 -4
- package/chunks/{action-HIL5ZFNB.js → action-HJYZCPUN.js} +5 -5
- package/chunks/{action-PAA4NWUJ.js → action-JAHFRYWZ.js} +58 -9
- package/chunks/{action-42D2C47G.js → action-LPVITMWA.js} +3 -3
- package/chunks/{action-P7RFXIC7.js → action-LVDU6YOI.js} +32 -23
- package/chunks/{action-HXHBU7XC.js → action-N7BA5I3E.js} +37 -12
- package/chunks/{action-W62AIEBN.js → action-NVI5DWFP.js} +6 -6
- package/chunks/{action-PHLOE27S.js → action-OX2566BE.js} +32 -25
- package/chunks/{action-DCINFQ57.js → action-QYGOPSTY.js} +13 -13
- package/chunks/{action-6MZZHPVQ.js → action-RBOLLIGX.js} +27 -14
- package/chunks/{action-LFL3ZZKN.js → action-SCOXTCPR.js} +15 -15
- package/chunks/{action-OILGZAMK.js → action-SNPOOW6S.js} +20 -15
- package/chunks/{action-V5KYG7XD.js → action-SRBN7N3R.js} +10 -10
- package/chunks/{action-XUQ7TKKJ.js → action-T5XMJXPO.js} +11 -7
- package/chunks/{action-6FAJNP6C.js → action-VOFDW3U2.js} +4 -4
- package/chunks/{action-SJYAMXYI.js → action-YRX6SN5F.js} +10 -4
- package/chunks/{agent-JAXLLDPE.js → agent-ASPV3R5U.js} +4 -4
- package/chunks/{asyncapi-P6Y3L7RG.js → asyncapi-H4FU6GPC.js} +10 -11
- package/chunks/{build.action-AZ5ECU4B.js → build.action-6V6GXI3X.js} +35 -31
- package/chunks/{chunk-FOKFF4EP.js → chunk-2DSVF5AD.js} +3 -3
- package/chunks/{chunk-HXIDUCSZ.js → chunk-2PPRO2QB.js} +1 -1
- package/chunks/{chunk-RPVHJMQT.js → chunk-4X47MN6Q.js} +2 -2
- package/chunks/{chunk-OQKDBLOZ.js → chunk-5JLVQVKO.js} +8 -0
- package/chunks/{chunk-VNYE4R7N.js → chunk-5UHLAJQD.js} +2 -1
- package/chunks/{chunk-CX7ZRMTC.js → chunk-6XWCMJDB.js} +1 -1
- package/chunks/{chunk-6ZMT63IV.js → chunk-6YPQGVF4.js} +1 -1
- package/chunks/{chunk-RAO7VUGM.js → chunk-BDEPNGTO.js} +1 -1
- package/chunks/{chunk-FQVVKQPU.js → chunk-BIKOD3SG.js} +134 -1
- package/chunks/{chunk-M622VXRQ.js → chunk-C2KAWRIX.js} +1 -1
- package/chunks/{chunk-NIXG4KDE.js → chunk-CWCETP6H.js} +170 -5
- package/chunks/chunk-EGOXR5FB.js +15 -0
- package/chunks/{chunk-3BWGTPPT.js → chunk-FDC2IESH.js} +1776 -1113
- package/chunks/{chunk-JV7TUEXQ.js → chunk-GPNB7ISG.js} +14 -1
- package/chunks/{chunk-SWWWYWHC.js → chunk-HGOD6THU.js} +27 -18
- package/chunks/{chunk-3DJ2GKEG.js → chunk-IMG35UXX.js} +1 -1
- package/chunks/{chunk-UB3XGOUW.js → chunk-ISXH6Q7I.js} +253 -9
- package/chunks/{chunk-MNLXYOVF.js → chunk-KCCFN4F7.js} +2 -2
- package/chunks/{chunk-KEOCJ3NJ.js → chunk-LG7IFACX.js} +38 -87
- package/chunks/{chunk-B2MHTD3R.js → chunk-MLSZVVTT.js} +1 -1
- package/chunks/{chunk-LCPFHE4Z.js → chunk-OJ2EWIJH.js} +21 -2
- package/chunks/{chunk-UMPODUJO.js → chunk-QXQZVEDC.js} +105 -15
- package/chunks/{chunk-CIFOFSZ3.js → chunk-R5LK6VPY.js} +72 -7
- package/chunks/{chunk-T7B6WNZC.js → chunk-TSURUX4A.js} +12 -3
- package/chunks/{chunk-HUCR333E.js → chunk-W24BETFG.js} +2 -2
- package/chunks/{chunk-LQN4S62O.js → chunk-XEDGMZJD.js} +18 -4
- package/chunks/{chunk-NNMSZVAB.js → chunk-XXSQUBXS.js} +82 -6
- package/chunks/{chunk-M6Q3ARBV.js → chunk-YILQODZF.js} +2 -2
- package/chunks/{chunk-TYLWJ2UL.js → chunk-ZJVYOZFB.js} +2 -2
- package/chunks/{create.action-34OTO2SB.js → create.action-P6DLCK4W.js} +27 -15
- package/chunks/{delete.action-6LRT4M3S.js → delete.action-HJKRRHE2.js} +24 -15
- package/chunks/{delete.action-ZYXFMIOW.js → delete.action-Z3GAA4ZN.js} +24 -15
- package/chunks/{get.action-XP36SA2J.js → get.action-IT4EHAV4.js} +10 -10
- package/chunks/{list.action-WVRVLX5E.js → list.action-2FU5UZNH.js} +15 -15
- package/chunks/{list.action-6LF6KSD5.js → list.action-WLIAO5UW.js} +13 -13
- package/chunks/{publish.action-AHFUBT5C.js → publish.action-T4J4DRXR.js} +48 -22
- package/chunks/{update.action-ZREAFJVG.js → update.action-3OVS3HWC.js} +25 -16
- package/chunks/{update.action-YQTVUDYE.js → update.action-MY7QPSSU.js} +25 -16
- package/docs.html +289 -96
- package/index.js +436 -401
- package/package.json +14 -22
- package/skills/scalar-cli/SKILL.md +71 -0
- package/template.md +81 -3
- package/chunks/action-YRWHX2AE.js +0 -64
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
RegistryResourceTypes,
|
|
4
4
|
baseRegistrySchema,
|
|
5
5
|
contentShaSchema
|
|
6
|
-
} from "./chunk-
|
|
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.
|
|
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-
|
|
4
|
+
} from "./chunk-GPNB7ISG.js";
|
|
5
5
|
import {
|
|
6
|
+
TeamUserRole,
|
|
6
7
|
roleSchema
|
|
7
|
-
} from "./chunk-
|
|
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.
|
|
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(
|
|
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
|
+
};
|