@malloy-publisher/server 0.12.4 → 0.12.5
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/dist/instrumentation.mjs +95 -10
- package/dist/package_load_worker.mjs +94 -9
- package/dist/server.mjs +840 -631
- package/package.json +2 -1
package/dist/server.mjs
CHANGED
|
@@ -108,8 +108,11 @@ function setting(entry) {
|
|
|
108
108
|
type: entry.type,
|
|
109
109
|
default: entry.default,
|
|
110
110
|
description: entry.description,
|
|
111
|
+
...entry.notes !== undefined ? { notes: entry.notes } : {},
|
|
112
|
+
...entry.defaultText !== undefined ? { defaultText: entry.defaultText } : {},
|
|
111
113
|
kind: entry.kind ?? "server",
|
|
112
114
|
secret: entry.secret ?? false,
|
|
115
|
+
...entry.masked ? { masked: true } : {},
|
|
113
116
|
aliases: entry.aliases ?? {}
|
|
114
117
|
};
|
|
115
118
|
}
|
|
@@ -278,6 +281,7 @@ var init_access = __esm(() => {
|
|
|
278
281
|
type: boolean(),
|
|
279
282
|
default: false,
|
|
280
283
|
description: "Allow publisher connections, which make this server call a configured connectionUri.",
|
|
284
|
+
notes: "Set to `true` to allow `publisher`-type proxy connections (Publisher-to-Publisher). See [connections.md](connections.md).",
|
|
281
285
|
aliases: {
|
|
282
286
|
env: ["PUBLISHER_ALLOW_PROXY_CONNECTIONS"],
|
|
283
287
|
today: { reads: "exactly-true" }
|
|
@@ -288,6 +292,7 @@ var init_access = __esm(() => {
|
|
|
288
292
|
type: boolean(),
|
|
289
293
|
default: false,
|
|
290
294
|
description: "Allow setupSQL on environment-authored DuckDB connections.",
|
|
295
|
+
notes: "Set to `true` to let environment-level `duckdb` connections carry `setupSQL`. Unset, a connection with `setupSQL` is refused at config load, on create and update, and by the connection test. `setupSQL` runs arbitrary DuckDB statements on the server, including writing host files and loading extensions, so enable it only where the people who author connections are trusted with the host. Refused under `EXTENSION_FETCH_POLICY=local-only` either way. Same boolean spellings as `PUBLISHER_ALLOW_UNVERIFIED_SSH_HOST_KEY`; any other value fails config load.",
|
|
291
296
|
aliases: { env: ["PUBLISHER_ALLOW_DUCKDB_SETUP_SQL"] }
|
|
292
297
|
}),
|
|
293
298
|
setting({
|
|
@@ -295,6 +300,7 @@ var init_access = __esm(() => {
|
|
|
295
300
|
type: boolean(),
|
|
296
301
|
default: false,
|
|
297
302
|
description: "Accept a bastion host key no connection pins.",
|
|
303
|
+
notes: "Set to `true` to let an SSH-proxy connection whose `ssh.hostKey` is not pinned connect anyway, logging a warning each time. Unset, such a tunnel is refused, because an unverified host key means a MITM on the publisher-to-bastion hop cannot be detected. Accepts the same spellings as every other boolean here -- `true`, `1`, `yes`, `on`, case-insensitive and trimmed. Any other value fails config load rather than opting in silently. See [connections.md](connections.md).",
|
|
298
304
|
aliases: { env: ["PUBLISHER_ALLOW_UNVERIFIED_SSH_HOST_KEY"] }
|
|
299
305
|
}),
|
|
300
306
|
setting({
|
|
@@ -302,6 +308,7 @@ var init_access = __esm(() => {
|
|
|
302
308
|
type: oneOf(["any", "destinations-only", "off"]),
|
|
303
309
|
default: "any",
|
|
304
310
|
description: "Where an s3 connection may use the host's credentials: any, destinations-only or off.",
|
|
311
|
+
notes: "Where an S3 connection or attachment may use `provider: credential_chain`, which makes DuckDB resolve the **host's own** credentials (an EKS pod's IRSA role, an EC2 instance profile) instead of a configured key pair. `any`: allowed everywhere. `destinations-only`: allowed on a [storage destination](connections.md#storage-destinations) and on an admin-API catalog, and refused on an environment connection or attachment, which an author may supply. A destination is declared by whoever writes the environment (its config file, or `storageDestinations` on `POST`/`PATCH /environments`), so under this policy keep those writes to operators. `off`: refused everywhere. A refused config fails at load, on create and update, and by the connection test, with an error naming the policy. Any other value fails startup.",
|
|
305
312
|
aliases: { env: ["S3_CREDENTIAL_CHAIN_POLICY"] }
|
|
306
313
|
}),
|
|
307
314
|
setting({
|
|
@@ -309,6 +316,7 @@ var init_access = __esm(() => {
|
|
|
309
316
|
type: string(),
|
|
310
317
|
secret: true,
|
|
311
318
|
description: "Secret a request presents in x-publisher-bypass-authorize to skip #(authorize) gates.",
|
|
319
|
+
notes: "A secret that, sent in the `x-publisher-bypass-authorize` header, skips `#(authorize)` gates for that request. Unset, the header does nothing. See [authorize-bypass-deployment.md](authorize-bypass-deployment.md).",
|
|
312
320
|
aliases: { env: ["PUBLISHER_BYPASS_AUTHORIZE_SECRET"] }
|
|
313
321
|
}),
|
|
314
322
|
setting({
|
|
@@ -316,6 +324,7 @@ var init_access = __esm(() => {
|
|
|
316
324
|
type: oneOf(["error", "warn", "info", "verbose", "debug", "silly"]),
|
|
317
325
|
default: "debug",
|
|
318
326
|
description: "Least severe level logged.",
|
|
327
|
+
notes: "One of `error`, `warn`, `info`, `verbose`, `debug`, `silly`.",
|
|
319
328
|
aliases: { env: ["LOG_LEVEL"], today: { invalid: "warn" } }
|
|
320
329
|
}),
|
|
321
330
|
setting({
|
|
@@ -323,6 +332,7 @@ var init_access = __esm(() => {
|
|
|
323
332
|
type: boolean(),
|
|
324
333
|
default: true,
|
|
325
334
|
description: "Log response bodies.",
|
|
335
|
+
notes: "Set to `true` or `1` to suppress response-body logging.",
|
|
326
336
|
aliases: {
|
|
327
337
|
env: ["DISABLE_RESPONSE_LOGGING"],
|
|
328
338
|
negated: true,
|
|
@@ -334,6 +344,7 @@ var init_access = __esm(() => {
|
|
|
334
344
|
type: integer({ min: 0 }),
|
|
335
345
|
default: 0,
|
|
336
346
|
description: "Seconds to report draining before closing the listeners on shutdown.",
|
|
347
|
+
notes: "After SIGTERM, how long to keep serving in-flight and new requests (readiness reports not-ready immediately) before the server starts refusing new traffic.",
|
|
337
348
|
aliases: {
|
|
338
349
|
env: ["SHUTDOWN_DRAIN_DURATION_SECONDS"],
|
|
339
350
|
flags: ["--shutdown_drain_duration_seconds"]
|
|
@@ -344,6 +355,7 @@ var init_access = __esm(() => {
|
|
|
344
355
|
type: integer({ min: 0 }),
|
|
345
356
|
default: 0,
|
|
346
357
|
description: "Seconds to wait after closing the listeners before exiting.",
|
|
358
|
+
notes: "Time to wait for in-flight requests to drain before forcing close.",
|
|
347
359
|
aliases: {
|
|
348
360
|
env: ["SHUTDOWN_GRACEFUL_CLOSE_TIMEOUT_SECONDS"],
|
|
349
361
|
flags: ["--shutdown_graceful_close_timeout_seconds"]
|
|
@@ -361,6 +373,8 @@ var init_admin = __esm(() => {
|
|
|
361
373
|
key: "admin.port",
|
|
362
374
|
type: integer({ min: 0, max: 65535 }),
|
|
363
375
|
description: "Port of the admin API; unset turns the listener off.",
|
|
376
|
+
notes: "Port for the admin API (`admin-api-doc.yaml`): the operator's surface: the DuckLake catalogs in `PUBLISHER_ADMIN_CATALOG_DATABASE` as resources (create a catalog, load a file into a table, list and drop tables, reclaim old snapshots' storage), and watch mode as one resource, `GET`/`PUT`/`DELETE /watch-mode` (the main API's `/watch-mode/status`, `start` and `stop` are deprecated). Off unless set. Unauthenticated, like the main API. See [ducklake.md](ducklake.md#managing-ducklake-catalogs-the-admin-api).",
|
|
377
|
+
defaultText: "_unset_ (off)",
|
|
364
378
|
aliases: {
|
|
365
379
|
env: ["PUBLISHER_ADMIN_PORT"],
|
|
366
380
|
flags: ["--admin_port"]
|
|
@@ -370,7 +384,8 @@ var init_admin = __esm(() => {
|
|
|
370
384
|
key: "admin.host",
|
|
371
385
|
type: string(),
|
|
372
386
|
default: "127.0.0.1",
|
|
373
|
-
description: "Host the admin API binds to; host does not move it.",
|
|
387
|
+
description: "Host the admin API binds to; {host} does not move it.",
|
|
388
|
+
notes: "Host binding for the admin API. Deliberately not moved by `PUBLISHER_HOST`: putting the main API on every interface does not expose the admin operations. Widen it only inside the network the orchestrator calls from, never behind a public ingress.",
|
|
374
389
|
aliases: { env: ["PUBLISHER_ADMIN_HOST"], flags: ["--admin_host"] }
|
|
375
390
|
}),
|
|
376
391
|
setting({
|
|
@@ -378,18 +393,22 @@ var init_admin = __esm(() => {
|
|
|
378
393
|
type: string(),
|
|
379
394
|
secret: true,
|
|
380
395
|
description: "libpq connection string of the database the admin API finds DuckLake catalogs in.",
|
|
396
|
+
notes: "A libpq connection string (keyword or `postgres://` form) for the Postgres database holding the catalogs the admin API manages. Unset, the admin API's catalog routes answer `503 CATALOG_DATABASE_NOT_CONFIGURED`.",
|
|
381
397
|
aliases: { env: ["PUBLISHER_ADMIN_CATALOG_DATABASE"] }
|
|
382
398
|
}),
|
|
383
399
|
setting({
|
|
384
400
|
key: "admin.storage.provider",
|
|
385
401
|
type: oneOf(["s3", "s3_credential_chain", "gcs"]),
|
|
386
402
|
description: "Object store the catalogs' data paths are read and written with.",
|
|
403
|
+
notes: "The credential the admin API reads and writes catalogs' data paths with: `s3` (with `PUBLISHER_ADMIN_STORAGE_KEY_ID`, `PUBLISHER_ADMIN_STORAGE_SECRET`, and optionally `PUBLISHER_ADMIN_STORAGE_REGION` and `PUBLISHER_ADMIN_STORAGE_ENDPOINT`), `s3_credential_chain` (the host's identity; optional region), or `gcs` (an HMAC key pair in the key id and secret variables). An unknown value or missing key fails startup.",
|
|
404
|
+
defaultText: "_unset_ (local paths)",
|
|
387
405
|
aliases: { env: ["PUBLISHER_ADMIN_STORAGE_PROVIDER"] }
|
|
388
406
|
}),
|
|
389
407
|
setting({
|
|
390
408
|
key: "admin.storage.keyId",
|
|
391
409
|
type: string(),
|
|
392
410
|
description: "Access key id (s3) or HMAC key id (gcs).",
|
|
411
|
+
masked: true,
|
|
393
412
|
aliases: { env: ["PUBLISHER_ADMIN_STORAGE_KEY_ID"] }
|
|
394
413
|
}),
|
|
395
414
|
setting({
|
|
@@ -425,13 +444,16 @@ var init_launch = __esm(() => {
|
|
|
425
444
|
default: ".",
|
|
426
445
|
kind: "launch",
|
|
427
446
|
description: "Directory served from, resolved against the working directory.",
|
|
447
|
+
notes: "Where Publisher keeps its own storage (`publisher_data/`, `publisher.db`), and where it looks for `publisher.config.json` when `--config` is not passed.",
|
|
448
|
+
defaultText: "`.` (cwd)",
|
|
428
449
|
aliases: { env: ["SERVER_ROOT"], flags: ["--server_root"] }
|
|
429
450
|
}),
|
|
430
451
|
setting({
|
|
431
452
|
key: "config",
|
|
432
453
|
type: string(),
|
|
433
454
|
kind: "launch",
|
|
434
|
-
description: "Path to publisher.config.json; default
|
|
455
|
+
description: "Path to publisher.config.json; default: the one in the server root.",
|
|
456
|
+
notes: "Path to the `publisher.config.json` to read, instead of the one in the server root. A path that does not exist is reported at startup, and the server starts with no environments.",
|
|
435
457
|
aliases: { env: ["PUBLISHER_CONFIG_PATH"], flags: ["--config"] }
|
|
436
458
|
}),
|
|
437
459
|
setting({
|
|
@@ -439,7 +461,9 @@ var init_launch = __esm(() => {
|
|
|
439
461
|
type: boolean(),
|
|
440
462
|
default: (resolving) => !resolving.isSet("root") && !resolving.isSet("config") && resolving.env("NODE_ENV") !== "test",
|
|
441
463
|
kind: "launch",
|
|
442
|
-
description: "Serve the bundled sample config when the server root has none; on when neither root nor config is given.",
|
|
464
|
+
description: "Serve the bundled sample config when the server root has none; on when neither {root} nor {config} is given.",
|
|
465
|
+
notes: "Set to `true` to fall back to the sample config bundled inside the installed package when neither `--config` is passed nor a `publisher.config.json` exists at the server root. The server sets this itself on a zero-flag start (so a bare `npx @malloy-publisher/server` boots the samples); passing `--config` or `--server_root` leaves it unset. Because the bundled config lives inside the install, relative package locations resolve against the server root in this mode rather than the config's directory.",
|
|
466
|
+
defaultText: "on unless a `--server_root` or `--config` flag is given; never in tests",
|
|
443
467
|
aliases: {
|
|
444
468
|
env: ["PUBLISHER_USE_BUNDLED_DEFAULT"],
|
|
445
469
|
today: { reads: "exactly-true", defaultFromFlags: true }
|
|
@@ -451,6 +475,7 @@ var init_launch = __esm(() => {
|
|
|
451
475
|
default: false,
|
|
452
476
|
kind: "launch",
|
|
453
477
|
description: "Wipe persisted storage and re-sync it from the config.",
|
|
478
|
+
notes: "Set to `true` (or pass `--init`) to **wipe persisted storage** (`publisher_data/`) and re-sync it from the config on boot. A first boot with empty storage loads the config automatically, so you only need this to reset state or pick up config changes. Also exposed as the `start:init` / `start:dev:init` scripts.",
|
|
454
479
|
aliases: {
|
|
455
480
|
env: ["INITIALIZE_STORAGE"],
|
|
456
481
|
flags: ["--init"],
|
|
@@ -463,6 +488,7 @@ var init_launch = __esm(() => {
|
|
|
463
488
|
default: [],
|
|
464
489
|
kind: "launch",
|
|
465
490
|
description: "Environments whose local packages are mounted in place for live reload; only the first auto-reloads.",
|
|
491
|
+
notes: "Dev only. Mount the named environment's local-dir packages in place (a symlink, not a copy) and watch them, so edits to your source recompile that package and live-reload any open pages. Repeat the flag or use a comma-separated list to mount several in place; only the first one auto-reloads. Leave unset in production, where packages are copied and stay decoupled from their source.",
|
|
466
492
|
aliases: {
|
|
467
493
|
env: ["PUBLISHER_WATCH"],
|
|
468
494
|
flags: ["--watch-env"],
|
|
@@ -482,6 +508,7 @@ var init_mcp = __esm(() => {
|
|
|
482
508
|
type: integer({ min: 0, max: 65535 }),
|
|
483
509
|
default: 4040,
|
|
484
510
|
description: "MCP HTTP port.",
|
|
511
|
+
notes: "MCP HTTP port. Serves the ten MCP tools (`list_packages`, `get_context`, `execute_query`, `compile_model`, `reload_package`, `get_status`, `search_malloy_docs`, `search_database_schema`, `get_skill`, `get_agent`) and the agent skills as MCP prompts. `list_packages` is listed first because it is where an agent starts: `get_context` requires an environment and package in its `scopes`, and those names come from there.",
|
|
485
512
|
aliases: {
|
|
486
513
|
env: ["MCP_PORT"],
|
|
487
514
|
flags: ["--mcp_port"]
|
|
@@ -491,7 +518,9 @@ var init_mcp = __esm(() => {
|
|
|
491
518
|
key: "mcp.host",
|
|
492
519
|
type: string(),
|
|
493
520
|
default: (resolving) => resolving.isSet("host") ? resolving.get("host") : "127.0.0.1",
|
|
494
|
-
description: "Host MCP binds to
|
|
521
|
+
description: "Host the MCP server binds to.",
|
|
522
|
+
notes: "Host binding for the MCP server. Takes precedence over `PUBLISHER_HOST`. Set `0.0.0.0` to expose MCP on the network, behind an authenticating gateway.",
|
|
523
|
+
defaultText: "{host} when given, else `127.0.0.1`",
|
|
495
524
|
aliases: { env: ["MCP_HOST"], flags: ["--mcp_host"] }
|
|
496
525
|
}),
|
|
497
526
|
setting({
|
|
@@ -499,13 +528,15 @@ var init_mcp = __esm(() => {
|
|
|
499
528
|
type: list(),
|
|
500
529
|
default: [],
|
|
501
530
|
description: "Origins that may read MCP responses cross-origin; * allows any, none denies.",
|
|
531
|
+
notes: "Comma-separated origins allowed to read a cross-origin response from the MCP endpoint; `*` allows any. Unset or empty sends no `Access-Control-Allow-Origin` at all.",
|
|
502
532
|
aliases: { env: ["MCP_CORS_ORIGINS"] }
|
|
503
533
|
}),
|
|
504
534
|
setting({
|
|
505
535
|
key: "mcp.configFileEnabled",
|
|
506
536
|
type: boolean(),
|
|
507
537
|
default: true,
|
|
508
|
-
description: "
|
|
538
|
+
description: "Do not write .mcp.json into the working directory. Without it the file is written, so an agent opened there finds this server, unless the directory already has one, is your home directory or the filesystem root, is inside a git working tree, or the MCP port bound is not the one requested.",
|
|
539
|
+
notes: "Stops the server writing a `.mcp.json` into its working directory on startup. Accepts `1`/`true`/`yes`/`on` to disable and `0`/`false`/`no`/`off`/empty to leave on; anything else, including a value an env file left quotes around, is a startup error rather than a disable. See [The `.mcp.json` the server writes](#the-mcpjson-the-server-writes).",
|
|
509
540
|
aliases: {
|
|
510
541
|
env: ["PUBLISHER_NO_MCP_CONFIG"],
|
|
511
542
|
flags: ["--no-mcp-config"],
|
|
@@ -526,6 +557,7 @@ var init_mcp = __esm(() => {
|
|
|
526
557
|
key: "mcp.trace",
|
|
527
558
|
type: oneOf(["retrieval"]),
|
|
528
559
|
description: "retrieval writes a trace summary of each ranked get_context call to the log.",
|
|
560
|
+
notes: "`retrieval` writes a one-line trace summary of each ranked `get_context` call to the server log, and adds nothing to any response. Any other value fails startup.",
|
|
529
561
|
aliases: { env: ["PUBLISHER_MCP_TRACE"] }
|
|
530
562
|
})
|
|
531
563
|
];
|
|
@@ -542,6 +574,7 @@ var init_query = __esm(() => {
|
|
|
542
574
|
type: integer({ min: 0 }),
|
|
543
575
|
default: DEFAULT_MAX_QUERY_ROWS,
|
|
544
576
|
description: "Row cap on ad-hoc connection SQL; 0 leaves only the byte cap.",
|
|
577
|
+
notes: "Maximum rows returned per query on every query surface (`/connections/.../sqlQuery`, model query, notebook cell, MCP `executeQuery`). Forwarded to the connector / Malloy `runnable.run` as the effective row limit; queries that exceed the cap fail with HTTP 413. Set to `0` to disable. A caller-supplied `rowLimit` smaller than the cap is preserved.",
|
|
545
578
|
aliases: { env: ["PUBLISHER_MAX_QUERY_ROWS"] }
|
|
546
579
|
}),
|
|
547
580
|
setting({
|
|
@@ -549,6 +582,8 @@ var init_query = __esm(() => {
|
|
|
549
582
|
type: integer({ min: 0 }),
|
|
550
583
|
default: DEFAULT_MAX_RESPONSE_BYTES,
|
|
551
584
|
description: "Byte cap on ad-hoc connection SQL responses; 0 leaves only the row cap.",
|
|
585
|
+
notes: "Maximum JSON-serialized response size, for ad-hoc SQL, model queries and notebook cells. Streaming-capable connections (Postgres, DuckDB) enforce mid-stream and abort the driver immediately; non-streaming connections enforce post-buffer. Exceeding the cap fails with HTTP 413. Set to `0` to disable. See the note below the table.",
|
|
586
|
+
defaultText: "`50000000` (50 MB)",
|
|
552
587
|
aliases: { env: ["PUBLISHER_MAX_RESPONSE_BYTES"] }
|
|
553
588
|
}),
|
|
554
589
|
setting({
|
|
@@ -556,6 +591,7 @@ var init_query = __esm(() => {
|
|
|
556
591
|
type: integer({ min: 1 }),
|
|
557
592
|
default: DEFAULT_QUERY_ROW_LIMIT,
|
|
558
593
|
description: "Row limit of a model query that sets none of its own.",
|
|
594
|
+
notes: "Default `LIMIT` applied to model queries that don't include their own. Always ≤ `PUBLISHER_MAX_QUERY_ROWS`. `0` is rejected.",
|
|
559
595
|
aliases: { env: ["PUBLISHER_DEFAULT_QUERY_ROW_LIMIT"] }
|
|
560
596
|
}),
|
|
561
597
|
setting({
|
|
@@ -563,6 +599,8 @@ var init_query = __esm(() => {
|
|
|
563
599
|
type: integer({ min: 0 }),
|
|
564
600
|
default: DEFAULT_QUERY_TIMEOUT_MS,
|
|
565
601
|
description: "Per-query wall-clock timeout in ms; 0 turns it off.",
|
|
602
|
+
notes: "Wall-clock timeout per query (all surfaces). Wired to the underlying SDK via `AbortSignal`; queries that exceed the budget are aborted and return HTTP 504. Set to `0` to disable.",
|
|
603
|
+
defaultText: "`300000` (5 min)",
|
|
566
604
|
aliases: { env: ["PUBLISHER_QUERY_TIMEOUT_MS"] }
|
|
567
605
|
}),
|
|
568
606
|
setting({
|
|
@@ -570,6 +608,7 @@ var init_query = __esm(() => {
|
|
|
570
608
|
type: integer({ min: 0 }),
|
|
571
609
|
default: DEFAULT_MAX_CONCURRENT_QUERIES,
|
|
572
610
|
description: "Queries this process runs at once; 0 turns the cap off.",
|
|
611
|
+
notes: "Per-pod cap on simultaneous in-flight work (HTTP + MCP share the same slot pool). Covers queries and the two authoring surfaces that also reach the database: `compile`, which resolves source schemas against the connection, and `sqlSource`, which runs a live introspection. When the cap is reached, new requests fail fast with HTTP 503 (or the MCP-error equivalent). Size it for authoring traffic as well as query traffic; set to `0` to disable.",
|
|
573
612
|
aliases: { env: ["PUBLISHER_MAX_CONCURRENT_QUERIES"] }
|
|
574
613
|
}),
|
|
575
614
|
setting({
|
|
@@ -577,6 +616,7 @@ var init_query = __esm(() => {
|
|
|
577
616
|
type: boolean(),
|
|
578
617
|
default: false,
|
|
579
618
|
description: "Attach per-query metadata to every statement.",
|
|
619
|
+
notes: "`on` attaches per-query metadata to every statement, as a leading SQL comment where the connection has no native tag; `off` attaches none. Only `on` and `off` are read. See [query-metadata.md](query-metadata.md).",
|
|
580
620
|
aliases: {
|
|
581
621
|
env: ["PUBLISHER_QUERY_METADATA"],
|
|
582
622
|
today: { reads: "on-off" }
|
|
@@ -587,6 +627,7 @@ var init_query = __esm(() => {
|
|
|
587
627
|
type: integer({ min: 1 }),
|
|
588
628
|
default: DEFAULT_POSTGRES_POOL_MAX,
|
|
589
629
|
description: "Open sessions per plain Postgres connection.",
|
|
630
|
+
notes: "Per-process cap on open database sessions for each Postgres connection, including one reached through an SSH proxy. Each query uses its own session and closes it; when all are busy a query waits up to 30 s for one, then fails with HTTP 502. Across a fleet the ceiling is roughly this value times the pods serving the environment, so size it against the role's `CONNECTION LIMIT`. Must be a positive integer.",
|
|
590
631
|
aliases: { env: ["PUBLISHER_POSTGRES_POOL_MAX"] }
|
|
591
632
|
}),
|
|
592
633
|
setting({
|
|
@@ -594,20 +635,24 @@ var init_query = __esm(() => {
|
|
|
594
635
|
type: integer({ min: 0 }),
|
|
595
636
|
default: 0,
|
|
596
637
|
description: "Process RSS ceiling for the memory governor, in bytes; 0 turns the governor off.",
|
|
638
|
+
notes: "Enables the RSS-based memory governor. When set, the governor samples process RSS every `PUBLISHER_MEMORY_CHECK_INTERVAL_MS` ms and rejects new package loads and queries with HTTP 503 once RSS crosses `PUBLISHER_MEMORY_HIGH_WATER_FRACTION × PUBLISHER_MAX_MEMORY_BYTES`, until it drops below `PUBLISHER_MEMORY_LOW_WATER_FRACTION ×`. Unset or `0` disables.",
|
|
639
|
+
defaultText: "`0` (the governor is off)",
|
|
597
640
|
aliases: { env: ["PUBLISHER_MAX_MEMORY_BYTES"] }
|
|
598
641
|
}),
|
|
599
642
|
setting({
|
|
600
643
|
key: "memory.highWaterFraction",
|
|
601
644
|
type: number({ above: 0, below: 1 }),
|
|
602
645
|
default: 0.8,
|
|
603
|
-
description: "Share of memory.maxBytes at which new package loads are refused.",
|
|
646
|
+
description: "Share of {memory.maxBytes} at which new package loads are refused.",
|
|
647
|
+
notes: "High-water mark (fraction of `PUBLISHER_MAX_MEMORY_BYTES`). Must be in `(0, 1)` and strictly above the low-water mark.",
|
|
604
648
|
aliases: { env: ["PUBLISHER_MEMORY_HIGH_WATER_FRACTION"] }
|
|
605
649
|
}),
|
|
606
650
|
setting({
|
|
607
651
|
key: "memory.lowWaterFraction",
|
|
608
652
|
type: number({ above: 0, below: 1 }),
|
|
609
653
|
default: 0.7,
|
|
610
|
-
description: "Share of memory.maxBytes at which loads are admitted again; below the high-water mark.",
|
|
654
|
+
description: "Share of {memory.maxBytes} at which loads are admitted again; below the high-water mark.",
|
|
655
|
+
notes: "Low-water mark (fraction of `PUBLISHER_MAX_MEMORY_BYTES`). Hysteresis: back-pressure clears when RSS dips below this value.",
|
|
611
656
|
aliases: { env: ["PUBLISHER_MEMORY_LOW_WATER_FRACTION"] }
|
|
612
657
|
}),
|
|
613
658
|
setting({
|
|
@@ -615,6 +660,7 @@ var init_query = __esm(() => {
|
|
|
615
660
|
type: integer({ min: 100 }),
|
|
616
661
|
default: 5000,
|
|
617
662
|
description: "How often the memory governor samples RSS, in ms.",
|
|
663
|
+
notes: "RSS sampling interval (ms). Minimum 100.",
|
|
618
664
|
aliases: { env: ["PUBLISHER_MEMORY_CHECK_INTERVAL_MS"] }
|
|
619
665
|
}),
|
|
620
666
|
setting({
|
|
@@ -622,6 +668,7 @@ var init_query = __esm(() => {
|
|
|
622
668
|
type: boolean(),
|
|
623
669
|
default: true,
|
|
624
670
|
description: "Refuse loads above the high-water mark; off only samples and reports.",
|
|
671
|
+
notes: "Set to `false` to disable the 503 behavior while keeping RSS monitoring — useful for a metrics-only rollout before enabling enforcement.",
|
|
625
672
|
aliases: { env: ["PUBLISHER_MEMORY_BACKPRESSURE"] }
|
|
626
673
|
}),
|
|
627
674
|
setting({
|
|
@@ -629,6 +676,7 @@ var init_query = __esm(() => {
|
|
|
629
676
|
type: integer({ min: 1 }),
|
|
630
677
|
default: 1,
|
|
631
678
|
description: "Package-load worker threads.",
|
|
679
|
+
notes: "Worker processes for package compilation. Must be ≥ 1.",
|
|
632
680
|
aliases: { env: ["PACKAGE_LOAD_WORKERS"] }
|
|
633
681
|
}),
|
|
634
682
|
setting({
|
|
@@ -636,6 +684,8 @@ var init_query = __esm(() => {
|
|
|
636
684
|
type: integer({ min: 1 }),
|
|
637
685
|
default: 120000,
|
|
638
686
|
description: "Compile budget of one package load, in ms.",
|
|
687
|
+
notes: "Bounds a package-load job's compile. A job may run to twice it before its worker is recycled, because the work it does for the main thread (render-tag results, pre-aggregation companions and the build plan) comes on top. The worker starts none of that work after three quarters of the timeout, and leaves what remains to the main thread.",
|
|
688
|
+
defaultText: "`120000` (2 min)",
|
|
639
689
|
aliases: { env: ["PACKAGE_LOAD_JOB_TIMEOUT_MS"] }
|
|
640
690
|
}),
|
|
641
691
|
setting({
|
|
@@ -643,6 +693,8 @@ var init_query = __esm(() => {
|
|
|
643
693
|
type: integer({ min: 0 }),
|
|
644
694
|
default: DEFAULT_PACKAGE_LOAD_SCHEMA_CACHE_BYTES,
|
|
645
695
|
description: "Serialized schema each package-load worker caches across loads, in bytes; 0 turns it off.",
|
|
696
|
+
notes: "Serialized size of the table and SQL schemas each package-load worker keeps across loads, so a model's repeated and later requests for the same table skip the round trip to the main thread. Least recently used entries go first. Scoped per environment and per connection instance, so editing a connection drops its entries; a request that asks to refresh a schema is fetched again, and the result replaces the entry. Heap use is a few times the serialized size. `0` disables it; empty takes the default, and a value that is not a byte count stops the server from starting.",
|
|
697
|
+
defaultText: "`16777216` (16 MiB)",
|
|
646
698
|
aliases: { env: ["PACKAGE_LOAD_SCHEMA_CACHE_BYTES"] }
|
|
647
699
|
})
|
|
648
700
|
];
|
|
@@ -666,12 +718,15 @@ var init_retrieval = __esm(() => {
|
|
|
666
718
|
type: string(),
|
|
667
719
|
secret: true,
|
|
668
720
|
description: "Key of the embedding provider; unset turns semantic search off, except for providers that need none.",
|
|
721
|
+
notes: 'Turns on embedding closeness in `get_context`\'s search, and embedding ranking in `search_database_schema` (see below). Sent as a bearer token to the embedding endpoint. Unset: `get_context` ranks by keyword and stored values only. Must be set explicitly; an ambient `OPENAI_API_KEY` is deliberately not read. See "How get_context searches" below.',
|
|
669
722
|
aliases: { env: ["EMBEDDING_API_KEY"] }
|
|
670
723
|
}),
|
|
671
724
|
setting({
|
|
672
725
|
key: "retrieval.embedding.model",
|
|
673
726
|
type: string(),
|
|
674
727
|
description: "Embedding model; text-embedding-3-small for OpenAI.",
|
|
728
|
+
notes: "Embedding model name sent to the endpoint. A `retrieval.embedding.model` in `publisher.config.json` wins over it.",
|
|
729
|
+
defaultText: "`text-embedding-3-small` for OpenAI",
|
|
675
730
|
aliases: {
|
|
676
731
|
env: ["EMBEDDING_MODEL"],
|
|
677
732
|
file: ["retrieval.embedding.model"],
|
|
@@ -682,6 +737,8 @@ var init_retrieval = __esm(() => {
|
|
|
682
737
|
key: "retrieval.embedding.baseUrl",
|
|
683
738
|
type: string(),
|
|
684
739
|
description: "Base URL of the embedding API; default the provider's, else https://api.openai.com/v1.",
|
|
740
|
+
notes: "Base URL of an OpenAI-compatible embeddings API (`POST <base>/embeddings`). Point at any compatible endpoint (e.g. a local Ollama or vLLM server). A `retrieval.embedding.baseUrl` in `publisher.config.json` wins over it.",
|
|
741
|
+
defaultText: "the provider's, else `https://api.openai.com/v1`",
|
|
685
742
|
aliases: {
|
|
686
743
|
env: ["EMBEDDING_API_BASE"],
|
|
687
744
|
file: ["retrieval.embedding.baseUrl"],
|
|
@@ -692,6 +749,7 @@ var init_retrieval = __esm(() => {
|
|
|
692
749
|
key: "retrieval.embedding.dimensions",
|
|
693
750
|
type: integer({ min: 1 }),
|
|
694
751
|
description: "dimensions request parameter; unset takes the provider's vector length.",
|
|
752
|
+
notes: "Optional `dimensions` request parameter (e.g. `512` to shrink `text-embedding-3-small` vectors). When unset the parameter is omitted, which suits providers that do not support it. A `retrieval.embedding.dimensions` in `publisher.config.json` wins over it.",
|
|
695
753
|
aliases: {
|
|
696
754
|
env: ["EMBEDDING_DIMENSIONS"],
|
|
697
755
|
file: ["retrieval.embedding.dimensions"],
|
|
@@ -702,7 +760,8 @@ var init_retrieval = __esm(() => {
|
|
|
702
760
|
key: "retrieval.embedding.minSimilarity",
|
|
703
761
|
type: number({ min: 0, below: 1 }),
|
|
704
762
|
default: DEFAULT_EMBEDDING_MIN_SIMILARITY,
|
|
705
|
-
description: "Cosine-similarity floor a
|
|
763
|
+
description: "Cosine-similarity floor a table must clear to be returned by search_database_schema.",
|
|
764
|
+
notes: "Cosine-similarity floor a table must clear to be returned by `search_database_schema`. `get_context` has no floor. Tunable because cosine similarity is not calibrated across embedding models, so the right floor belongs to the endpoint you point at, not to Publisher. Must be in `[0, 1)`; `0` disables the floor, and an out-of-range or non-numeric value is a startup error rather than a silent clamp.",
|
|
706
765
|
aliases: { env: ["EMBEDDING_MIN_SIMILARITY"] }
|
|
707
766
|
}),
|
|
708
767
|
setting({
|
|
@@ -710,6 +769,7 @@ var init_retrieval = __esm(() => {
|
|
|
710
769
|
type: boolean(),
|
|
711
770
|
default: false,
|
|
712
771
|
description: "Let search_database_schema send a connection's table and column names to the embedding provider.",
|
|
772
|
+
notes: "Allows `search_database_schema` to send a connection's schema name, table names, column names and column types, plus the agent's search text, to the embedding endpoint for semantic ranking. Never row values. A second switch on top of `EMBEDDING_API_KEY`, which alone covers only your own model text; unset, schema search still works and ranks lexically. Accepts `1`/`true`/`yes`/`on` and `0`/`false`/`no`/`off`. It is read when the tool is called, not at startup, so an unrecognised value does not stop the server: the tool logs a warning and ranks lexically for that call. See \"Semantic ranking for search_database_schema\" below.",
|
|
713
773
|
aliases: { env: ["EMBEDDING_INDEX_CONNECTION_SCHEMA"] }
|
|
714
774
|
}),
|
|
715
775
|
setting({
|
|
@@ -717,6 +777,7 @@ var init_retrieval = __esm(() => {
|
|
|
717
777
|
type: string(),
|
|
718
778
|
secret: true,
|
|
719
779
|
description: "Key of the retrieval LLM; unset turns every LLM feature off, except for providers that need none.",
|
|
780
|
+
notes: 'API key for the chat model named by `retrieval.llm` in `publisher.config.json` (OpenAI, an OpenAI-compatible server, Anthropic or Google; not needed for `ollama` or `vertex`). Used for index-time keyphrases and source summaries. Unset with a keyed provider: every LLM feature is off and nothing errors. Never read from a file, never logged. See "Providers and the retrieval settings" below.',
|
|
720
781
|
aliases: { env: ["LLM_API_KEY"] }
|
|
721
782
|
})
|
|
722
783
|
];
|
|
@@ -740,6 +801,7 @@ var init_server = __esm(() => {
|
|
|
740
801
|
type: boolean(),
|
|
741
802
|
default: true,
|
|
742
803
|
description: "Run the main API and MCP, and the environments they serve; off runs only the admin API.",
|
|
804
|
+
notes: "The top-level `servingApiEnabled` setting ([below](#server-settings-top-level-of-publisherconfigjson)); overrides the config file.",
|
|
743
805
|
aliases: {
|
|
744
806
|
env: ["PUBLISHER_SERVING_API_ENABLED"],
|
|
745
807
|
flags: ["--serving-api-enabled", "--no-serving-api-enabled"],
|
|
@@ -752,6 +814,7 @@ var init_server = __esm(() => {
|
|
|
752
814
|
type: boolean(),
|
|
753
815
|
default: true,
|
|
754
816
|
description: "Allow the admin API; off refuses an admin setting.",
|
|
817
|
+
notes: "The top-level `adminApiEnabled` setting ([below](#server-settings-top-level-of-publisherconfigjson)); overrides the config file.",
|
|
755
818
|
aliases: {
|
|
756
819
|
env: ["PUBLISHER_ADMIN_API_ENABLED"],
|
|
757
820
|
flags: ["--admin-api-enabled", "--no-admin-api-enabled"],
|
|
@@ -764,6 +827,7 @@ var init_server = __esm(() => {
|
|
|
764
827
|
type: integer({ min: 0, max: 65535 }),
|
|
765
828
|
default: 4000,
|
|
766
829
|
description: "Port of the REST API and the web app.",
|
|
830
|
+
notes: "REST + static-app HTTP port.",
|
|
767
831
|
aliases: {
|
|
768
832
|
env: ["PUBLISHER_PORT"],
|
|
769
833
|
flags: ["--port"]
|
|
@@ -773,7 +837,8 @@ var init_server = __esm(() => {
|
|
|
773
837
|
key: "host",
|
|
774
838
|
type: string(),
|
|
775
839
|
default: "0.0.0.0",
|
|
776
|
-
description: "Host the REST API binds to, and MCP too unless mcp.host is given.",
|
|
840
|
+
description: "Host the REST API binds to, and MCP too unless {mcp.host} is given.",
|
|
841
|
+
notes: "Host binding for the REST server, and the fallback for the MCP server. Set `127.0.0.1` to keep both loopback-only.",
|
|
777
842
|
aliases: { env: ["PUBLISHER_HOST"], flags: ["--host"] }
|
|
778
843
|
}),
|
|
779
844
|
setting({
|
|
@@ -781,6 +846,8 @@ var init_server = __esm(() => {
|
|
|
781
846
|
type: integer({ min: 0 }),
|
|
782
847
|
default: 0,
|
|
783
848
|
description: "Requests per minute per client; 0 is unlimited.",
|
|
849
|
+
notes: "Maximum requests per minute one client may make to the REST server; over it, requests get `429` with `RateLimit-*` headers until the minute rolls over. Unset or `0` means no limit; any other value must be a non-negative integer or startup fails. `/health*` and `/metrics` are never limited. Clients are told apart by the connection's peer address, so behind a reverse proxy every client shares one bucket: rate-limit at the proxy there, or leave this unset. The MCP port is not covered.",
|
|
850
|
+
defaultText: "`0` (no limit)",
|
|
784
851
|
aliases: { env: ["PUBLISHER_RATE_LIMIT"] }
|
|
785
852
|
}),
|
|
786
853
|
setting({
|
|
@@ -788,6 +855,7 @@ var init_server = __esm(() => {
|
|
|
788
855
|
type: string(),
|
|
789
856
|
default: "'self'",
|
|
790
857
|
description: "The Content-Security-Policy frame-ancestors source list: who may embed the app.",
|
|
858
|
+
notes: "`Content-Security-Policy: frame-ancestors` value sent on **every** document this server returns -- the Console and in-package `public/` files alike -- controlling which origins may embed a page in an iframe. Defaults to same-origin only; set it to the origins that embed you (`https://app.example.com`), or to `*` to restore the previous any-origin behaviour.",
|
|
791
859
|
aliases: { env: ["PUBLISHER_FRAME_ANCESTORS"] }
|
|
792
860
|
}),
|
|
793
861
|
setting({
|
|
@@ -795,6 +863,7 @@ var init_server = __esm(() => {
|
|
|
795
863
|
type: string(),
|
|
796
864
|
default: DEFAULT_CALLER_HEADER,
|
|
797
865
|
description: "Request header the access record copies as the caller: the identity the gateway in front of Publisher asserts.",
|
|
866
|
+
notes: "The request header whose value the per-query access record copies as `caller`: the identity the gateway in front of Publisher asserts. Opaque to Publisher; see [access-record.md](access-record.md).",
|
|
798
867
|
aliases: { env: ["PUBLISHER_CALLER_HEADER"] }
|
|
799
868
|
}),
|
|
800
869
|
setting({
|
|
@@ -802,6 +871,7 @@ var init_server = __esm(() => {
|
|
|
802
871
|
type: oneOf(["off", "on"]),
|
|
803
872
|
default: "off",
|
|
804
873
|
description: "on publishes a package from a location as the version its publisher.json declares; off installs it in place. A transition setting #1381 removes.",
|
|
874
|
+
notes: "`on` or `off`: whether a publish from a location publishes an immutable [package version](package-versions.md) numbered by its `publisher.json` `version` (a missing or non-semver `version` is then a 400), or installs the package in place as before versions. A transition setting: a future release removes it and requires a `version` ([#1381](https://github.com/malloydata/publisher/issues/1381)). Versions published while it was on keep serving when it is off. Any other value fails startup.",
|
|
805
875
|
aliases: { env: ["PUBLISHER_PACKAGE_VERSIONING"] }
|
|
806
876
|
}),
|
|
807
877
|
setting({
|
|
@@ -809,6 +879,7 @@ var init_server = __esm(() => {
|
|
|
809
879
|
type: oneOf(["on-publish", "explicit"]),
|
|
810
880
|
default: "on-publish",
|
|
811
881
|
description: "on-publish moves a package's latest to a newly published higher version; explicit leaves it to PUT …/latest.",
|
|
882
|
+
notes: "`on-publish` or `explicit`: what publishing a package version does to its `latest`. `on-publish` moves `latest` to the new version unless a higher one already is; `explicit` never moves it, so only `PUT .../packages/{package}/latest` does, for an orchestrator that decides when a version is ready. Also settable as `versionPromotion` in `publisher.config.json`; the variable wins. Any other value fails startup. See [package-versions.md](package-versions.md).",
|
|
812
883
|
aliases: {
|
|
813
884
|
env: ["PUBLISHER_VERSION_PROMOTION"],
|
|
814
885
|
file: ["versionPromotion"]
|
|
@@ -819,6 +890,7 @@ var init_server = __esm(() => {
|
|
|
819
890
|
type: oneOf(["off", "on"]),
|
|
820
891
|
default: "on",
|
|
821
892
|
description: "on keeps the fields that moved off Package (buildPlan, agents, secureGivens, embeddingIndex, the manifest-binding and serving fields) inline in a package response, marked deprecated; off leaves each where it now lives. A transition setting a later release turns off, then removes.",
|
|
893
|
+
notes: "`on` or `off`: whether a package response carries the deprecated fields `api-doc.yaml` marks on `Package`, and a `GET /status` entry the whole package response. Off, each is read only at its own route: the serving and manifest-binding fields (`status`, `loaded`, `archiveStatus`, `servedRevision`, `sourceContentSha`, `manifestBindingStatus`, `manifestEntryCount`, `boundManifestUri`, `storageServeBindings`) at `GET …/packages/{pkg}/status`, `buildPlan` at `…/build-plan`, `embeddingIndex` at `…/embedding-index`, `classification` at `…/classification`, `agents` at `…/agents`, and `secureGivens` as each model's `givens[].secure` at `…/entities`. `warnings` and `exploresWarnings` stay on the package either way. A transition flag: a later release turns it off by default and the one after removes it with the fields, so move readers to the new locations now. Any other value fails startup.",
|
|
822
894
|
aliases: { env: ["PUBLISHER_PACKAGE_INLINE_FIELDS"] }
|
|
823
895
|
}),
|
|
824
896
|
setting({
|
|
@@ -826,6 +898,7 @@ var init_server = __esm(() => {
|
|
|
826
898
|
type: oneOf(["explorer", "viewer"]),
|
|
827
899
|
default: "explorer",
|
|
828
900
|
description: "The page the Console shows for a model, reported on /status as modelPage: explorer, or viewer, which builds no query and takes the Explorer out of the legacy notebook too.",
|
|
901
|
+
notes: "`explorer` or `viewer`: the page the Console shows for a model, reported on `/status` as `modelPage`. `explorer` is the [Explorer](explorer.md), which writes the queries it builds back to Malloy with string values unescaped (`escapeString` in `@malloydata/malloy-interfaces` is a TODO), so a drilled value holding a double quote rewrites its query; the server's restricted mode and `#(authorize)` still bound what that query can read. `viewer` shows the model viewer, which builds no query, and also takes the Explorer's \"Data sources\" dialog out of the legacy notebook; there a given's option list also quotes every name. The Console keeps both pages, and shows the viewer if `/status` cannot be read. Any other value fails startup.",
|
|
829
902
|
aliases: { env: ["PUBLISHER_MODEL_PAGE"] }
|
|
830
903
|
}),
|
|
831
904
|
setting({
|
|
@@ -855,18 +928,21 @@ var init_storage = __esm(() => {
|
|
|
855
928
|
type: oneOf(["on-demand", "local-only"]),
|
|
856
929
|
default: "on-demand",
|
|
857
930
|
description: "on-demand installs a missing DuckDB extension on first use; local-only never reaches the network.",
|
|
931
|
+
notes: "Whether the server may fetch DuckDB extensions from the network at runtime. `on-demand`: a missing extension is installed on first use (unchanged prior behavior). `local-only`: never install, and disable DuckDB's implicit auto-install — a locally-present (e.g. image-baked) extension still loads, but a missing one fails with an actionable error naming the extension. Use `local-only` for air-gapped / pinned-image deployments. See [ducklake.md](ducklake.md#duckdb-extension-provisioning).",
|
|
858
932
|
aliases: { env: ["EXTENSION_FETCH_POLICY"] }
|
|
859
933
|
}),
|
|
860
934
|
setting({
|
|
861
935
|
key: "duckdb.memoryLimit",
|
|
862
936
|
type: string(),
|
|
863
937
|
description: "memory_limit of every DuckDB session, as a DuckDB size (1GB), or off; unset warns at boot.",
|
|
938
|
+
notes: "DuckDB `memory_limit` applied to **every** DuckDB session and instance Publisher owns, as a flat value (`1GB`, `512MB`) passed to DuckDB verbatim. `off` or unset leaves DuckDB's own default, which is roughly 80% of the container's memory computed **per instance** — so N instances in one process commit N times that share, and the kernel kills the process while each of them still believes it is inside its budget. Measured in a 3 GiB container: three instances each reported a 2.3 GiB limit, 6.9 GiB of committed budget against 3 GiB of real memory. **Sizing:** the divisor is not a number of builds. Count 1 metadata store + 1 serve-shape gate session + 1 environment lookup funnel + one sandbox per loaded package × `PACKAGE_LOAD_WORKERS` (package loads run in `worker_threads`, so same address space and same cgroup) + one per in-flight materialization build, and nothing bounds concurrent builds. Budget roughly (container memory − resident baseline) ÷ that count. DuckDB does not reserve the limit up front, so an idle instance costs far less than its budget — the limit caps what it may reach, and it is the sum of the caps that has to fit. Too low fails a query with a DuckDB out-of-memory error and leaves the process up, which is the intended trade against losing the pod and every package on it. Validated at startup.",
|
|
864
939
|
aliases: { env: ["PUBLISHER_DUCKDB_MEMORY_LIMIT"] }
|
|
865
940
|
}),
|
|
866
941
|
setting({
|
|
867
942
|
key: "duckdb.tempDirectory",
|
|
868
943
|
type: string(),
|
|
869
944
|
description: "Directory DuckDB spills to.",
|
|
945
|
+
notes: "Where DuckDB spills. A materialization build overrides this with its own disposable working directory (unique per build, removed with the build); every other session and instance uses this. Unset leaves DuckDB's default of `.tmp` relative to the process working directory, whose default `max_temp_directory_size` is 90% of whatever filesystem that lands on — on a container with no ephemeral-storage limit, the node's shared disk. Created at startup if missing, since `SET temp_directory` accepts a path that does not exist and only fails at the first spill. Unlike the memory limit there is no `off` sentinel, because a directory named `off` is a legal path. Note that setting `PUBLISHER_DUCKDB_MEMORY_LIMIT` creates spill on the `storage=` build path in one case: a `partition=` build sorts the whole passthrough result by its partition columns in DuckDB before writing it (see `PUBLISHER_PARTITIONED_WRITE_FLUSH_THRESHOLD`), and that sort runs out of core against the build's own working directory, so the entire result can land on local disk. Every other `storage=` build pushes its SQL to the source warehouse and streams the result into the destination with nothing to spill. Local compute, and so spill, is otherwise the chained-build and serve paths.",
|
|
870
946
|
aliases: { env: ["PUBLISHER_DUCKDB_TEMP_DIRECTORY"] }
|
|
871
947
|
}),
|
|
872
948
|
setting({
|
|
@@ -874,18 +950,21 @@ var init_storage = __esm(() => {
|
|
|
874
950
|
type: string(),
|
|
875
951
|
default: "8192",
|
|
876
952
|
description: "Rows a partitioned storage build buffers before flushing, or off.",
|
|
953
|
+
notes: "Rows the appender buffers before a `#@ persist partition=` build flushes them to the partition files, set on the build session as DuckDB's `partitioned_write_flush_threshold`. `off` turns the whole treatment off — this threshold, the ordered insert and the single appender thread together — and leaves DuckDB's own behaviour (a 524,288-row threshold, an unordered parallel insert); it is the escape hatch for a source that built fine before, at the cost of the sort. A partitioned build is DuckDB's partitioned COPY, and that operator buffers rows per partition in a column-data collection **inside** the buffer manager — so unlike the two DuckLake bounds above, `PUBLISHER_DUCKDB_MEMORY_LIMIT` does see this term, and the failure reads `Out of Memory Error: failed to pin block` against the session's limit rather than a container kill. Two things drive it: every partition the appender meets costs it one vector per column up front, before a row of it is flushed, and nothing is flushed until it has appended this many rows across all its partitions. On a passthrough-sourced build (Postgres, BigQuery, Snowflake; a chained build is untouched) the publisher bounds the first by ordering the insert's SELECT by the partition columns at the top of the INSERT statement — the SELECT the build was handed is unchanged, so what the warehouse runs, its query tag or label, and how the source is addressed are untouched — and by running that insert on one thread, since a DuckDB-side sort is read in parallel and several appenders each meet every partition again; this variable bounds the second. Sorted by DuckDB rather than by the warehouse because a multi-stream read (BigQuery) re-interleaves a sorted result on the way in. Measured at a `768MB` limit on 122 columns, 616k rows, 308 partitions: from Postgres, interleaved rows fail in under 3 s at any threshold, ordered rows fail at DuckDB's default after ~0.5M rows, ordered rows on one thread complete at `8192` in 9.5 s (4 threads fail at 7 s); from BigQuery, interleaved fails at 54 s and ordered on one thread completes in 36 s (4 threads fail at 39 s). Snowflake is not measured; the write side is the same. The treatment has a running cost: the sort reads the whole result before the first partition file is written, spills it to the build's working directory when it exceeds the memory limit, and writes on one thread — so a wide, many-partition build trades memory for local disk and wall-clock, and no production-scale build has been measured yet. The disk is the one to watch: the working directory is created under the process temp directory, which in a container with no volume there is the node's overlay filesystem, and a spill of tens of GB there is an ephemeral-storage eviction — a killed pod, not a publisher error. Give the worker a volume for its temp directory, or an ephemeral-storage limit that makes the failure a caught one, before relying on this at that scale. The single thread costs little on a single-stream read (`postgres_query`, `snowflake_query`, `bigquery_query`) and real scan parallelism on the labelled BigQuery split, whose result table is read multi-stream. An incremental delta into a laid-out table runs on the same session and gets the threshold and the single thread; its read is not ordered. Smaller is not free: a flush touches every partition the appender holds, so a very high-cardinality layout (thousands of partitions) does more file work at a low value — that is the many-small-files layout `docs/materialization.md` already warns off. Validated at startup.",
|
|
877
954
|
aliases: { env: ["PUBLISHER_PARTITIONED_WRITE_FLUSH_THRESHOLD"] }
|
|
878
955
|
}),
|
|
879
956
|
setting({
|
|
880
957
|
key: "ducklake.rowGroupSizeBytes",
|
|
881
958
|
type: string(),
|
|
882
959
|
description: "Bytes DuckLake buffers per column before flushing a Parquet row group (16MB).",
|
|
960
|
+
notes: "Bytes DuckLake buffers per Parquet row group before flushing, applied as a **catalog** option on each writable lake at attach. Unset issues nothing and leaves DuckLake's default of 122,880 ROWS. A DuckLake write buffers a whole row group per COLUMN, so its memory is driven by the table's width rather than its row count, and `PUBLISHER_DUCKDB_MEMORY_LIMIT` does not bound it — those buffers sit outside the buffer manager, so a low limit and a large row group OOM together. Measured on a 72-column, 5M-row write, sampling cgroup `memory.stat` anon: 2772 MiB at the default, 1530 MiB at `64MB`, 1006 MiB at `16MB`. Bytes rather than a row count because one row count cannot suit a 9-column and a 110-column table at once; the byte form derives rows-per-group from the data actually buffered, so it tracks width with nobody estimating it. Smaller is not free: more row groups cost Parquet metadata and read-side pruning quality, and the read cost has not been measured here. Requires `preserve_insertion_order=false`, which Publisher sets on the attaching session — DuckLake plans its copy parallel unconditionally and does not honour insertion order regardless (measured: 15 adjacent inversions per 1.5M rows with it on, 10 with it off), so the guarantee being waived is not one that was being provided. Written to `ducklake_metadata`, so it outlives the connection and is seen by every writer of that lake; skipped on a read-only attach. A catalog that refuses the option is logged and attaches anyway. Validated at startup.",
|
|
883
961
|
aliases: { env: ["PUBLISHER_DUCKLAKE_ROW_GROUP_SIZE_BYTES"] }
|
|
884
962
|
}),
|
|
885
963
|
setting({
|
|
886
964
|
key: "ducklake.targetFileSizeBytes",
|
|
887
965
|
type: string(),
|
|
888
966
|
description: "Size a DuckLake Parquet file grows to before rotating (256MB).",
|
|
967
|
+
notes: "Bytes DuckLake writes into one Parquet file before rotating to the next, applied as a **catalog** option on each writable lake at attach. Unset issues nothing and leaves DuckLake's own default of roughly 512MB. A separate term from `PUBLISHER_DUCKLAKE_ROW_GROUP_SIZE_BYTES`, not a replacement: that bounds the per-column buffer _within_ a file, this bounds how much of the file stays resident. Writing to object storage, DuckDB copies each multipart part into a buffer it allocates itself and holds it until the file completes, so a file's bytes are resident however they are grouped inside it — and `PUBLISHER_DUCKDB_MEMORY_LIMIT` bounds neither, since both sit outside the buffer manager. The same write to a local path streams and shows none of this, so the cost is invisible to testing that does not target a cloud destination. Measured on a 72-column, 20M-row DuckLake write to GCS, all cells in one batch: 650 MiB at DuckLake's default, 550 MiB at `512MB`, 373 MiB at `256MB`, 262 MiB at `128MB`, 255 MiB at `64MB`. **Pick the largest value that clears your memory ceiling, not the smallest** — memory is the only axis where smaller wins and it stops improving below ~`128MB`, while write throughput, full-scan time and catalog size all get worse (a full scan measured 13.0s at `512MB` against 21.6s at `64MB`; the catalog holds one row per file per column, in a database every writer of that lake shares). Where sources carry a required equality filter, scan time is the least binding of the three: a selective lookup ran in 17–63 ms at every size tested. Unlike the row-group bound it does **not** require `preserve_insertion_order=false`, and the order the two are applied in does not matter. Written to `ducklake_metadata`, so it outlives the connection and is seen by every writer of that lake; skipped on a read-only attach. **Unsetting this variable does not revert it** — the last value written stays in the catalog; to change it back, run `CALL <lake>.set_option('target_file_size', '<value>')` against the catalog. A catalog that refuses the option is logged and attaches anyway. Validated at startup.",
|
|
889
968
|
aliases: { env: ["PUBLISHER_DUCKLAKE_TARGET_FILE_SIZE_BYTES"] }
|
|
890
969
|
}),
|
|
891
970
|
setting({
|
|
@@ -893,6 +972,7 @@ var init_storage = __esm(() => {
|
|
|
893
972
|
type: oneOf(["off", "write-only", "on"]),
|
|
894
973
|
default: "off",
|
|
895
974
|
description: "How #@ persist storage= is honored: off, write-only (build only) or on (build and serve).",
|
|
975
|
+
notes: "Controls the `#@ persist storage=<name>` materialization tier (materialize a source into a registered [storage destination](connections.md#storage-destinations) and serve it from there — a destination is declared alongside `connections`, not in it, and is not nameable from a model). `off`: the `storage=` annotation is inert — sources build and serve from their own warehouse exactly as without it. `write-only`: materialize into the storage destination but still serve live (the measurement rung). `on`: build **and** serve from the storage table via the virtual-source transform. Read at startup. A kill switch: moving it **down** never fails a loaded package — a `storage=` source just reverts to serving live and surfaces as a package warning. See [persist-storage-tutorial.md](persist-storage-tutorial.md).",
|
|
896
976
|
aliases: { env: ["PERSIST_STORAGE_MODE"] }
|
|
897
977
|
}),
|
|
898
978
|
setting({
|
|
@@ -900,6 +980,7 @@ var init_storage = __esm(() => {
|
|
|
900
980
|
type: boolean(),
|
|
901
981
|
default: false,
|
|
902
982
|
description: "Refuse a publish where two persist sources resolve to the same table.",
|
|
983
|
+
notes: "Set to `true` to refuse a publish in which two persist sources of one package resolve to the same table in the same destination. Off, a collision is a warning; loading a package only ever warns.",
|
|
903
984
|
aliases: { env: ["PERSIST_COLLISION_ENFORCE"] }
|
|
904
985
|
}),
|
|
905
986
|
setting({
|
|
@@ -907,6 +988,7 @@ var init_storage = __esm(() => {
|
|
|
907
988
|
type: boolean(),
|
|
908
989
|
default: false,
|
|
909
990
|
description: "Fire packages' materialization schedules from this process; never on an orchestrated worker.",
|
|
991
|
+
notes: "Opt-in: enable the standalone materialization scheduler, which fires each loaded package's `materialization.schedule` cron, and each published package version's (see [package-versions.md](package-versions.md#materializations)), so a self-hosted Publisher rebuilds on a cadence with no control plane. **Never set this on a control-plane-driven (orchestrated) worker** — it is the primary guard against double-driving refresh. See [materialization.md](materialization.md).",
|
|
910
992
|
aliases: { env: ["PUBLISHER_LOCAL_MATERIALIZATION_SCHEDULER"] }
|
|
911
993
|
}),
|
|
912
994
|
setting({
|
|
@@ -914,6 +996,8 @@ var init_storage = __esm(() => {
|
|
|
914
996
|
type: integer({ min: 1000 }),
|
|
915
997
|
default: 60000,
|
|
916
998
|
description: "How often the scheduler looks for due schedules, in ms.",
|
|
999
|
+
notes: "How often the scheduler sweeps for due schedules, in ms. Minimum `1000`. Only read when the scheduler is enabled.",
|
|
1000
|
+
defaultText: "`60000` (1 min)",
|
|
917
1001
|
aliases: { env: ["PUBLISHER_MATERIALIZATION_SCHEDULER_INTERVAL_MS"] }
|
|
918
1002
|
}),
|
|
919
1003
|
setting({
|
|
@@ -921,6 +1005,7 @@ var init_storage = __esm(() => {
|
|
|
921
1005
|
type: integer({ min: 1 }),
|
|
922
1006
|
default: 10,
|
|
923
1007
|
description: "Packages the scheduler fires per look.",
|
|
1008
|
+
notes: "Stampede guard: max packages fired per sweep. A capped package fires on a later tick. Must be a positive integer.",
|
|
924
1009
|
aliases: {
|
|
925
1010
|
env: ["PUBLISHER_MATERIALIZATION_SCHEDULER_MAX_FIRES_PER_TICK"]
|
|
926
1011
|
}
|
|
@@ -166294,7 +166379,7 @@ var init_telemetry = __esm(() => {
|
|
|
166294
166379
|
});
|
|
166295
166380
|
|
|
166296
166381
|
// package.json
|
|
166297
|
-
var version = "0.12.
|
|
166382
|
+
var version = "0.12.5";
|
|
166298
166383
|
var init_package = () => {};
|
|
166299
166384
|
|
|
166300
166385
|
// src/version.ts
|
|
@@ -166444,6 +166529,151 @@ var init_instrumentation = __esm(() => {
|
|
|
166444
166529
|
]);
|
|
166445
166530
|
});
|
|
166446
166531
|
|
|
166532
|
+
// src/settings/reference.ts
|
|
166533
|
+
var exports_reference = {};
|
|
166534
|
+
__export(exports_reference, {
|
|
166535
|
+
withReferenceTable: () => withReferenceTable,
|
|
166536
|
+
settingsReferenceTable: () => settingsReferenceTable,
|
|
166537
|
+
settingsLine: () => settingsLine,
|
|
166538
|
+
helpText: () => helpText,
|
|
166539
|
+
REFERENCE_START: () => REFERENCE_START,
|
|
166540
|
+
REFERENCE_END: () => REFERENCE_END
|
|
166541
|
+
});
|
|
166542
|
+
function settingsReferenceTable() {
|
|
166543
|
+
const rows = NAMED.map((entry) => [
|
|
166544
|
+
code(entry.key),
|
|
166545
|
+
cell((entry.aliases.env ?? []).map(code).join(", ")),
|
|
166546
|
+
cell(flagSpecs(entry).map(code).join(", ")),
|
|
166547
|
+
cell(defaultText(entry, "markdown")),
|
|
166548
|
+
cell(withReferences(entry.notes ?? entry.description, "markdown"))
|
|
166549
|
+
].join(" | "));
|
|
166550
|
+
return [
|
|
166551
|
+
"| Setting | Env var | CLI flag | Default | Meaning |",
|
|
166552
|
+
"| --- | --- | --- | --- | --- |",
|
|
166553
|
+
...rows.map((row) => `| ${row} |`)
|
|
166554
|
+
].join(`
|
|
166555
|
+
`);
|
|
166556
|
+
}
|
|
166557
|
+
function withReferenceTable(doc) {
|
|
166558
|
+
const start = doc.indexOf(REFERENCE_START);
|
|
166559
|
+
const end = doc.indexOf(REFERENCE_END);
|
|
166560
|
+
if (start < 0 || end < start)
|
|
166561
|
+
return doc;
|
|
166562
|
+
return doc.slice(0, start + REFERENCE_START.length) + `
|
|
166563
|
+
|
|
166564
|
+
` + settingsReferenceTable() + `
|
|
166565
|
+
|
|
166566
|
+
` + doc.slice(end);
|
|
166567
|
+
}
|
|
166568
|
+
function helpText() {
|
|
166569
|
+
const flagged = NAMED.filter((entry) => (entry.aliases.flags ?? []).length > 0).map((entry) => ({ entry, spec: flagSpecs(entry).join(", ") }));
|
|
166570
|
+
const width = Math.max(...flagged.map(({ spec }) => spec.length)) + 2;
|
|
166571
|
+
const lines = flagged.map(({ entry, spec }) => {
|
|
166572
|
+
const fallback = defaultText(entry, "text");
|
|
166573
|
+
return ` ${spec.padEnd(width)}${withReferences(entry.description, "text")}${fallback ? ` (default: ${fallback})` : ""}`;
|
|
166574
|
+
});
|
|
166575
|
+
return [
|
|
166576
|
+
"Malloy Publisher Server",
|
|
166577
|
+
"",
|
|
166578
|
+
"Usage: malloy-publisher [options]",
|
|
166579
|
+
"",
|
|
166580
|
+
"Options:",
|
|
166581
|
+
...lines,
|
|
166582
|
+
` ${"--help, -h".padEnd(width)}Show this help message`,
|
|
166583
|
+
"",
|
|
166584
|
+
"Every setting can also be given as an environment variable; see docs/configuration.md."
|
|
166585
|
+
].join(`
|
|
166586
|
+
`);
|
|
166587
|
+
}
|
|
166588
|
+
function settingsLine(settings2) {
|
|
166589
|
+
const given = REGISTRY.filter((entry) => settings2.isSet(entry.key)).map((entry) => {
|
|
166590
|
+
const key = entry.key;
|
|
166591
|
+
const from = describeSource(settings2.source(key));
|
|
166592
|
+
if (entry.kind === "structured")
|
|
166593
|
+
return `${entry.key} from ${from}`;
|
|
166594
|
+
let shown;
|
|
166595
|
+
try {
|
|
166596
|
+
shown = entry.secret || entry.masked ? "(set)" : JSON.stringify(withoutUrlCredentials(settings2.get(key)));
|
|
166597
|
+
} catch {
|
|
166598
|
+
shown = "(invalid)";
|
|
166599
|
+
}
|
|
166600
|
+
return `${entry.key}=${shown} from ${from}`;
|
|
166601
|
+
});
|
|
166602
|
+
return given.length === 0 ? "Settings: every setting is at its default." : `Settings given: ${given.join(", ")}`;
|
|
166603
|
+
}
|
|
166604
|
+
function withoutUrlCredentials(value) {
|
|
166605
|
+
if (Array.isArray(value))
|
|
166606
|
+
return value.map(withoutUrlCredentials);
|
|
166607
|
+
if (typeof value !== "string")
|
|
166608
|
+
return value;
|
|
166609
|
+
const scheme = /^[a-z][a-z0-9+.-]*:\/\//i.exec(value)?.[0];
|
|
166610
|
+
const at = value.lastIndexOf("@");
|
|
166611
|
+
if (scheme === undefined || at < scheme.length)
|
|
166612
|
+
return value;
|
|
166613
|
+
return `${scheme}***${value.slice(at)}`;
|
|
166614
|
+
}
|
|
166615
|
+
function withReferences(text, style) {
|
|
166616
|
+
return text.replace(/\{([a-zA-Z][a-zA-Z.]*)\}/g, (whole, key) => {
|
|
166617
|
+
const entry = REGISTRY.find((candidate) => candidate.key === key);
|
|
166618
|
+
if (!entry)
|
|
166619
|
+
return whole;
|
|
166620
|
+
if (style === "markdown")
|
|
166621
|
+
return code(key);
|
|
166622
|
+
return entry.aliases.flags?.[0] ?? entry.aliases.env?.[0] ?? key;
|
|
166623
|
+
});
|
|
166624
|
+
}
|
|
166625
|
+
function flagSpecs(entry) {
|
|
166626
|
+
const flags = entry.aliases.flags ?? [];
|
|
166627
|
+
if (entry.type instanceof BooleanType)
|
|
166628
|
+
return [...flags];
|
|
166629
|
+
return flags.map((flag) => `${flag} <${valueName(entry)}>`);
|
|
166630
|
+
}
|
|
166631
|
+
function valueName(entry) {
|
|
166632
|
+
if (entry.type instanceof IntegerType || entry.type instanceof NumberType) {
|
|
166633
|
+
return "n";
|
|
166634
|
+
}
|
|
166635
|
+
if (entry.type instanceof ListType)
|
|
166636
|
+
return "name";
|
|
166637
|
+
if (entry.key === "root")
|
|
166638
|
+
return "dir";
|
|
166639
|
+
if (entry.key === "config")
|
|
166640
|
+
return "path";
|
|
166641
|
+
if (entry.key.endsWith("host"))
|
|
166642
|
+
return "addr";
|
|
166643
|
+
return "value";
|
|
166644
|
+
}
|
|
166645
|
+
function defaultText(entry, style) {
|
|
166646
|
+
if (entry.aliases.negated)
|
|
166647
|
+
return style === "markdown" ? "_unset_" : "";
|
|
166648
|
+
if (entry.defaultText !== undefined) {
|
|
166649
|
+
return style === "markdown" ? withReferences(entry.defaultText, style) : withReferences(entry.defaultText.replace(/[`_]/g, ""), style);
|
|
166650
|
+
}
|
|
166651
|
+
const fallback = entry.default;
|
|
166652
|
+
if (fallback === undefined)
|
|
166653
|
+
return style === "markdown" ? "_unset_" : "";
|
|
166654
|
+
if (typeof fallback === "boolean" && style === "text") {
|
|
166655
|
+
return fallback ? "on" : "off";
|
|
166656
|
+
}
|
|
166657
|
+
if (Array.isArray(fallback) && fallback.length === 0) {
|
|
166658
|
+
return style === "markdown" ? "_none_" : "";
|
|
166659
|
+
}
|
|
166660
|
+
const shown = Array.isArray(fallback) ? fallback.join(",") : String(fallback);
|
|
166661
|
+
return style === "markdown" ? code(shown) : shown;
|
|
166662
|
+
}
|
|
166663
|
+
function code(text) {
|
|
166664
|
+
return `\`${text}\``;
|
|
166665
|
+
}
|
|
166666
|
+
function cell(text) {
|
|
166667
|
+
return text.replace(/\n+/g, " ").replace(/(?<!\\)\|/g, "\\|");
|
|
166668
|
+
}
|
|
166669
|
+
var NAMED, REFERENCE_START = "<!-- settings-reference:start (generated from src/settings/registry; run `bun run generate-settings-reference`) -->", REFERENCE_END = "<!-- settings-reference:end -->";
|
|
166670
|
+
var init_reference = __esm(() => {
|
|
166671
|
+
init_errors();
|
|
166672
|
+
init_registry();
|
|
166673
|
+
init_types();
|
|
166674
|
+
NAMED = REGISTRY.filter((entry) => (entry.aliases.env ?? []).length > 0 || (entry.aliases.flags ?? []).length > 0);
|
|
166675
|
+
});
|
|
166676
|
+
|
|
166447
166677
|
// src/service/http_retry.ts
|
|
166448
166678
|
function publicMessage(error) {
|
|
166449
166679
|
const own = error?.publicMessage;
|
|
@@ -168348,16 +168578,16 @@ var require_statuses = __commonJS((exports, module) => {
|
|
|
168348
168578
|
};
|
|
168349
168579
|
function createMessageToStatusCodeMap(codes2) {
|
|
168350
168580
|
var map = {};
|
|
168351
|
-
Object.keys(codes2).forEach(function forEachCode(
|
|
168352
|
-
var message = codes2[
|
|
168353
|
-
var status2 = Number(
|
|
168581
|
+
Object.keys(codes2).forEach(function forEachCode(code2) {
|
|
168582
|
+
var message = codes2[code2];
|
|
168583
|
+
var status2 = Number(code2);
|
|
168354
168584
|
map[message.toLowerCase()] = status2;
|
|
168355
168585
|
});
|
|
168356
168586
|
return map;
|
|
168357
168587
|
}
|
|
168358
168588
|
function createStatusCodeList(codes2) {
|
|
168359
|
-
return Object.keys(codes2).map(function mapCode(
|
|
168360
|
-
return Number(
|
|
168589
|
+
return Object.keys(codes2).map(function mapCode(code2) {
|
|
168590
|
+
return Number(code2);
|
|
168361
168591
|
});
|
|
168362
168592
|
}
|
|
168363
168593
|
function getStatusCode(message) {
|
|
@@ -168367,24 +168597,24 @@ var require_statuses = __commonJS((exports, module) => {
|
|
|
168367
168597
|
}
|
|
168368
168598
|
return status.code[msg];
|
|
168369
168599
|
}
|
|
168370
|
-
function getStatusMessage(
|
|
168371
|
-
if (!Object.prototype.hasOwnProperty.call(status.message,
|
|
168372
|
-
throw new Error("invalid status code: " +
|
|
168600
|
+
function getStatusMessage(code2) {
|
|
168601
|
+
if (!Object.prototype.hasOwnProperty.call(status.message, code2)) {
|
|
168602
|
+
throw new Error("invalid status code: " + code2);
|
|
168373
168603
|
}
|
|
168374
|
-
return status.message[
|
|
168604
|
+
return status.message[code2];
|
|
168375
168605
|
}
|
|
168376
|
-
function status(
|
|
168377
|
-
if (typeof
|
|
168378
|
-
return getStatusMessage(
|
|
168606
|
+
function status(code2) {
|
|
168607
|
+
if (typeof code2 === "number") {
|
|
168608
|
+
return getStatusMessage(code2);
|
|
168379
168609
|
}
|
|
168380
|
-
if (typeof
|
|
168610
|
+
if (typeof code2 !== "string") {
|
|
168381
168611
|
throw new TypeError("code must be a number or string");
|
|
168382
168612
|
}
|
|
168383
|
-
var n = parseInt(
|
|
168613
|
+
var n = parseInt(code2, 10);
|
|
168384
168614
|
if (!isNaN(n)) {
|
|
168385
168615
|
return getStatusMessage(n);
|
|
168386
168616
|
}
|
|
168387
|
-
return getStatusCode(
|
|
168617
|
+
return getStatusCode(code2);
|
|
168388
168618
|
}
|
|
168389
168619
|
});
|
|
168390
168620
|
|
|
@@ -168473,10 +168703,10 @@ var require_http_errors = __commonJS((exports, module) => {
|
|
|
168473
168703
|
inherits(HttpError, Error);
|
|
168474
168704
|
return HttpError;
|
|
168475
168705
|
}
|
|
168476
|
-
function createClientErrorConstructor(HttpError, name,
|
|
168706
|
+
function createClientErrorConstructor(HttpError, name, code2) {
|
|
168477
168707
|
var className = toClassName(name);
|
|
168478
168708
|
function ClientError(message) {
|
|
168479
|
-
var msg = message != null ? message : statuses.message[
|
|
168709
|
+
var msg = message != null ? message : statuses.message[code2];
|
|
168480
168710
|
var err = new Error(msg);
|
|
168481
168711
|
Error.captureStackTrace(err, ClientError);
|
|
168482
168712
|
setPrototypeOf(err, ClientError.prototype);
|
|
@@ -168496,8 +168726,8 @@ var require_http_errors = __commonJS((exports, module) => {
|
|
|
168496
168726
|
}
|
|
168497
168727
|
inherits(ClientError, HttpError);
|
|
168498
168728
|
nameFunc(ClientError, className);
|
|
168499
|
-
ClientError.prototype.status =
|
|
168500
|
-
ClientError.prototype.statusCode =
|
|
168729
|
+
ClientError.prototype.status = code2;
|
|
168730
|
+
ClientError.prototype.statusCode = code2;
|
|
168501
168731
|
ClientError.prototype.expose = true;
|
|
168502
168732
|
return ClientError;
|
|
168503
168733
|
}
|
|
@@ -168512,10 +168742,10 @@ var require_http_errors = __commonJS((exports, module) => {
|
|
|
168512
168742
|
return val instanceof Error && typeof val.expose === "boolean" && typeof val.statusCode === "number" && val.status === val.statusCode;
|
|
168513
168743
|
};
|
|
168514
168744
|
}
|
|
168515
|
-
function createServerErrorConstructor(HttpError, name,
|
|
168745
|
+
function createServerErrorConstructor(HttpError, name, code2) {
|
|
168516
168746
|
var className = toClassName(name);
|
|
168517
168747
|
function ServerError(message) {
|
|
168518
|
-
var msg = message != null ? message : statuses.message[
|
|
168748
|
+
var msg = message != null ? message : statuses.message[code2];
|
|
168519
168749
|
var err = new Error(msg);
|
|
168520
168750
|
Error.captureStackTrace(err, ServerError);
|
|
168521
168751
|
setPrototypeOf(err, ServerError.prototype);
|
|
@@ -168535,8 +168765,8 @@ var require_http_errors = __commonJS((exports, module) => {
|
|
|
168535
168765
|
}
|
|
168536
168766
|
inherits(ServerError, HttpError);
|
|
168537
168767
|
nameFunc(ServerError, className);
|
|
168538
|
-
ServerError.prototype.status =
|
|
168539
|
-
ServerError.prototype.statusCode =
|
|
168768
|
+
ServerError.prototype.status = code2;
|
|
168769
|
+
ServerError.prototype.statusCode = code2;
|
|
168540
168770
|
ServerError.prototype.expose = false;
|
|
168541
168771
|
return ServerError;
|
|
168542
168772
|
}
|
|
@@ -168548,19 +168778,19 @@ var require_http_errors = __commonJS((exports, module) => {
|
|
|
168548
168778
|
}
|
|
168549
168779
|
}
|
|
168550
168780
|
function populateConstructorExports(exports2, codes, HttpError) {
|
|
168551
|
-
codes.forEach(function forEachCode(
|
|
168781
|
+
codes.forEach(function forEachCode(code2) {
|
|
168552
168782
|
var CodeError;
|
|
168553
|
-
var name = toIdentifier(statuses.message[
|
|
168554
|
-
switch (codeClass(
|
|
168783
|
+
var name = toIdentifier(statuses.message[code2]);
|
|
168784
|
+
switch (codeClass(code2)) {
|
|
168555
168785
|
case 400:
|
|
168556
|
-
CodeError = createClientErrorConstructor(HttpError, name,
|
|
168786
|
+
CodeError = createClientErrorConstructor(HttpError, name, code2);
|
|
168557
168787
|
break;
|
|
168558
168788
|
case 500:
|
|
168559
|
-
CodeError = createServerErrorConstructor(HttpError, name,
|
|
168789
|
+
CodeError = createServerErrorConstructor(HttpError, name, code2);
|
|
168560
168790
|
break;
|
|
168561
168791
|
}
|
|
168562
168792
|
if (CodeError) {
|
|
168563
|
-
exports2[
|
|
168793
|
+
exports2[code2] = CodeError;
|
|
168564
168794
|
exports2[name] = CodeError;
|
|
168565
168795
|
}
|
|
168566
168796
|
});
|
|
@@ -170375,22 +170605,22 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
170375
170605
|
var part = chunk[k];
|
|
170376
170606
|
if (typeof part === "string") {
|
|
170377
170607
|
for (var l = 0;l < part.length; ) {
|
|
170378
|
-
var
|
|
170379
|
-
if (55296 <=
|
|
170608
|
+
var code2 = part.charCodeAt(l++);
|
|
170609
|
+
if (55296 <= code2 && code2 < 56320) {
|
|
170380
170610
|
var codeTrail = part.charCodeAt(l++);
|
|
170381
170611
|
if (56320 <= codeTrail && codeTrail < 57344)
|
|
170382
|
-
writeTable[curAddr++] = 65536 + (
|
|
170612
|
+
writeTable[curAddr++] = 65536 + (code2 - 55296) * 1024 + (codeTrail - 56320);
|
|
170383
170613
|
else
|
|
170384
170614
|
throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]);
|
|
170385
|
-
} else if (4080 <
|
|
170386
|
-
var len = 4095 -
|
|
170615
|
+
} else if (4080 < code2 && code2 <= 4095) {
|
|
170616
|
+
var len = 4095 - code2 + 2;
|
|
170387
170617
|
var seq = [];
|
|
170388
170618
|
for (var m2 = 0;m2 < len; m2++)
|
|
170389
170619
|
seq.push(part.charCodeAt(l++));
|
|
170390
170620
|
writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
|
|
170391
170621
|
this.decodeTableSeq.push(seq);
|
|
170392
170622
|
} else
|
|
170393
|
-
writeTable[curAddr++] =
|
|
170623
|
+
writeTable[curAddr++] = code2;
|
|
170394
170624
|
}
|
|
170395
170625
|
} else if (typeof part === "number") {
|
|
170396
170626
|
var charCode = writeTable[curAddr - 1] + 1;
|
|
@@ -185348,16 +185578,16 @@ var require_statuses2 = __commonJS((exports, module) => {
|
|
|
185348
185578
|
};
|
|
185349
185579
|
function createMessageToStatusCodeMap(codes2) {
|
|
185350
185580
|
var map = {};
|
|
185351
|
-
Object.keys(codes2).forEach(function forEachCode(
|
|
185352
|
-
var message = codes2[
|
|
185353
|
-
var status2 = Number(
|
|
185581
|
+
Object.keys(codes2).forEach(function forEachCode(code2) {
|
|
185582
|
+
var message = codes2[code2];
|
|
185583
|
+
var status2 = Number(code2);
|
|
185354
185584
|
map[message.toLowerCase()] = status2;
|
|
185355
185585
|
});
|
|
185356
185586
|
return map;
|
|
185357
185587
|
}
|
|
185358
185588
|
function createStatusCodeList(codes2) {
|
|
185359
|
-
return Object.keys(codes2).map(function mapCode(
|
|
185360
|
-
return Number(
|
|
185589
|
+
return Object.keys(codes2).map(function mapCode(code2) {
|
|
185590
|
+
return Number(code2);
|
|
185361
185591
|
});
|
|
185362
185592
|
}
|
|
185363
185593
|
function getStatusCode(message) {
|
|
@@ -185367,24 +185597,24 @@ var require_statuses2 = __commonJS((exports, module) => {
|
|
|
185367
185597
|
}
|
|
185368
185598
|
return status.code[msg];
|
|
185369
185599
|
}
|
|
185370
|
-
function getStatusMessage(
|
|
185371
|
-
if (!Object.prototype.hasOwnProperty.call(status.message,
|
|
185372
|
-
throw new Error("invalid status code: " +
|
|
185600
|
+
function getStatusMessage(code2) {
|
|
185601
|
+
if (!Object.prototype.hasOwnProperty.call(status.message, code2)) {
|
|
185602
|
+
throw new Error("invalid status code: " + code2);
|
|
185373
185603
|
}
|
|
185374
|
-
return status.message[
|
|
185604
|
+
return status.message[code2];
|
|
185375
185605
|
}
|
|
185376
|
-
function status(
|
|
185377
|
-
if (typeof
|
|
185378
|
-
return getStatusMessage(
|
|
185606
|
+
function status(code2) {
|
|
185607
|
+
if (typeof code2 === "number") {
|
|
185608
|
+
return getStatusMessage(code2);
|
|
185379
185609
|
}
|
|
185380
|
-
if (typeof
|
|
185610
|
+
if (typeof code2 !== "string") {
|
|
185381
185611
|
throw new TypeError("code must be a number or string");
|
|
185382
185612
|
}
|
|
185383
|
-
var n = parseInt(
|
|
185613
|
+
var n = parseInt(code2, 10);
|
|
185384
185614
|
if (!isNaN(n)) {
|
|
185385
185615
|
return getStatusMessage(n);
|
|
185386
185616
|
}
|
|
185387
|
-
return getStatusCode(
|
|
185617
|
+
return getStatusCode(code2);
|
|
185388
185618
|
}
|
|
185389
185619
|
});
|
|
185390
185620
|
|
|
@@ -187144,10 +187374,10 @@ var require_http_errors2 = __commonJS((exports, module) => {
|
|
|
187144
187374
|
inherits(HttpError, Error);
|
|
187145
187375
|
return HttpError;
|
|
187146
187376
|
}
|
|
187147
|
-
function createClientErrorConstructor(HttpError, name,
|
|
187377
|
+
function createClientErrorConstructor(HttpError, name, code2) {
|
|
187148
187378
|
var className = toClassName(name);
|
|
187149
187379
|
function ClientError(message) {
|
|
187150
|
-
var msg = message != null ? message : statuses.message[
|
|
187380
|
+
var msg = message != null ? message : statuses.message[code2];
|
|
187151
187381
|
var err = new Error(msg);
|
|
187152
187382
|
Error.captureStackTrace(err, ClientError);
|
|
187153
187383
|
setPrototypeOf(err, ClientError.prototype);
|
|
@@ -187167,8 +187397,8 @@ var require_http_errors2 = __commonJS((exports, module) => {
|
|
|
187167
187397
|
}
|
|
187168
187398
|
inherits(ClientError, HttpError);
|
|
187169
187399
|
nameFunc(ClientError, className);
|
|
187170
|
-
ClientError.prototype.status =
|
|
187171
|
-
ClientError.prototype.statusCode =
|
|
187400
|
+
ClientError.prototype.status = code2;
|
|
187401
|
+
ClientError.prototype.statusCode = code2;
|
|
187172
187402
|
ClientError.prototype.expose = true;
|
|
187173
187403
|
return ClientError;
|
|
187174
187404
|
}
|
|
@@ -187183,10 +187413,10 @@ var require_http_errors2 = __commonJS((exports, module) => {
|
|
|
187183
187413
|
return val instanceof Error && typeof val.expose === "boolean" && typeof val.statusCode === "number" && val.status === val.statusCode;
|
|
187184
187414
|
};
|
|
187185
187415
|
}
|
|
187186
|
-
function createServerErrorConstructor(HttpError, name,
|
|
187416
|
+
function createServerErrorConstructor(HttpError, name, code2) {
|
|
187187
187417
|
var className = toClassName(name);
|
|
187188
187418
|
function ServerError(message) {
|
|
187189
|
-
var msg = message != null ? message : statuses.message[
|
|
187419
|
+
var msg = message != null ? message : statuses.message[code2];
|
|
187190
187420
|
var err = new Error(msg);
|
|
187191
187421
|
Error.captureStackTrace(err, ServerError);
|
|
187192
187422
|
setPrototypeOf(err, ServerError.prototype);
|
|
@@ -187206,8 +187436,8 @@ var require_http_errors2 = __commonJS((exports, module) => {
|
|
|
187206
187436
|
}
|
|
187207
187437
|
inherits(ServerError, HttpError);
|
|
187208
187438
|
nameFunc(ServerError, className);
|
|
187209
|
-
ServerError.prototype.status =
|
|
187210
|
-
ServerError.prototype.statusCode =
|
|
187439
|
+
ServerError.prototype.status = code2;
|
|
187440
|
+
ServerError.prototype.statusCode = code2;
|
|
187211
187441
|
ServerError.prototype.expose = false;
|
|
187212
187442
|
return ServerError;
|
|
187213
187443
|
}
|
|
@@ -187219,19 +187449,19 @@ var require_http_errors2 = __commonJS((exports, module) => {
|
|
|
187219
187449
|
}
|
|
187220
187450
|
}
|
|
187221
187451
|
function populateConstructorExports(exports2, codes, HttpError) {
|
|
187222
|
-
codes.forEach(function forEachCode(
|
|
187452
|
+
codes.forEach(function forEachCode(code2) {
|
|
187223
187453
|
var CodeError;
|
|
187224
|
-
var name = toIdentifier(statuses.message[
|
|
187225
|
-
switch (codeClass(
|
|
187454
|
+
var name = toIdentifier(statuses.message[code2]);
|
|
187455
|
+
switch (codeClass(code2)) {
|
|
187226
187456
|
case 400:
|
|
187227
|
-
CodeError = createClientErrorConstructor(HttpError, name,
|
|
187457
|
+
CodeError = createClientErrorConstructor(HttpError, name, code2);
|
|
187228
187458
|
break;
|
|
187229
187459
|
case 500:
|
|
187230
|
-
CodeError = createServerErrorConstructor(HttpError, name,
|
|
187460
|
+
CodeError = createServerErrorConstructor(HttpError, name, code2);
|
|
187231
187461
|
break;
|
|
187232
187462
|
}
|
|
187233
187463
|
if (CodeError) {
|
|
187234
|
-
exports2[
|
|
187464
|
+
exports2[code2] = CodeError;
|
|
187235
187465
|
exports2[name] = CodeError;
|
|
187236
187466
|
}
|
|
187237
187467
|
});
|
|
@@ -199198,10 +199428,10 @@ var require_http_errors3 = __commonJS((exports, module) => {
|
|
|
199198
199428
|
inherits(HttpError, Error);
|
|
199199
199429
|
return HttpError;
|
|
199200
199430
|
}
|
|
199201
|
-
function createClientErrorConstructor(HttpError, name,
|
|
199431
|
+
function createClientErrorConstructor(HttpError, name, code2) {
|
|
199202
199432
|
var className = toClassName(name);
|
|
199203
199433
|
function ClientError(message) {
|
|
199204
|
-
var msg = message != null ? message : statuses.message[
|
|
199434
|
+
var msg = message != null ? message : statuses.message[code2];
|
|
199205
199435
|
var err = new Error(msg);
|
|
199206
199436
|
Error.captureStackTrace(err, ClientError);
|
|
199207
199437
|
setPrototypeOf(err, ClientError.prototype);
|
|
@@ -199221,8 +199451,8 @@ var require_http_errors3 = __commonJS((exports, module) => {
|
|
|
199221
199451
|
}
|
|
199222
199452
|
inherits(ClientError, HttpError);
|
|
199223
199453
|
nameFunc(ClientError, className);
|
|
199224
|
-
ClientError.prototype.status =
|
|
199225
|
-
ClientError.prototype.statusCode =
|
|
199454
|
+
ClientError.prototype.status = code2;
|
|
199455
|
+
ClientError.prototype.statusCode = code2;
|
|
199226
199456
|
ClientError.prototype.expose = true;
|
|
199227
199457
|
return ClientError;
|
|
199228
199458
|
}
|
|
@@ -199237,10 +199467,10 @@ var require_http_errors3 = __commonJS((exports, module) => {
|
|
|
199237
199467
|
return val instanceof Error && typeof val.expose === "boolean" && typeof val.statusCode === "number" && val.status === val.statusCode;
|
|
199238
199468
|
};
|
|
199239
199469
|
}
|
|
199240
|
-
function createServerErrorConstructor(HttpError, name,
|
|
199470
|
+
function createServerErrorConstructor(HttpError, name, code2) {
|
|
199241
199471
|
var className = toClassName(name);
|
|
199242
199472
|
function ServerError(message) {
|
|
199243
|
-
var msg = message != null ? message : statuses.message[
|
|
199473
|
+
var msg = message != null ? message : statuses.message[code2];
|
|
199244
199474
|
var err = new Error(msg);
|
|
199245
199475
|
Error.captureStackTrace(err, ServerError);
|
|
199246
199476
|
setPrototypeOf(err, ServerError.prototype);
|
|
@@ -199260,8 +199490,8 @@ var require_http_errors3 = __commonJS((exports, module) => {
|
|
|
199260
199490
|
}
|
|
199261
199491
|
inherits(ServerError, HttpError);
|
|
199262
199492
|
nameFunc(ServerError, className);
|
|
199263
|
-
ServerError.prototype.status =
|
|
199264
|
-
ServerError.prototype.statusCode =
|
|
199493
|
+
ServerError.prototype.status = code2;
|
|
199494
|
+
ServerError.prototype.statusCode = code2;
|
|
199265
199495
|
ServerError.prototype.expose = false;
|
|
199266
199496
|
return ServerError;
|
|
199267
199497
|
}
|
|
@@ -199273,19 +199503,19 @@ var require_http_errors3 = __commonJS((exports, module) => {
|
|
|
199273
199503
|
}
|
|
199274
199504
|
}
|
|
199275
199505
|
function populateConstructorExports(exports2, codes, HttpError) {
|
|
199276
|
-
codes.forEach(function forEachCode(
|
|
199506
|
+
codes.forEach(function forEachCode(code2) {
|
|
199277
199507
|
var CodeError;
|
|
199278
|
-
var name = toIdentifier(statuses.message[
|
|
199279
|
-
switch (codeClass(
|
|
199508
|
+
var name = toIdentifier(statuses.message[code2]);
|
|
199509
|
+
switch (codeClass(code2)) {
|
|
199280
199510
|
case 400:
|
|
199281
|
-
CodeError = createClientErrorConstructor(HttpError, name,
|
|
199511
|
+
CodeError = createClientErrorConstructor(HttpError, name, code2);
|
|
199282
199512
|
break;
|
|
199283
199513
|
case 500:
|
|
199284
|
-
CodeError = createServerErrorConstructor(HttpError, name,
|
|
199514
|
+
CodeError = createServerErrorConstructor(HttpError, name, code2);
|
|
199285
199515
|
break;
|
|
199286
199516
|
}
|
|
199287
199517
|
if (CodeError) {
|
|
199288
|
-
exports2[
|
|
199518
|
+
exports2[code2] = CodeError;
|
|
199289
199519
|
exports2[name] = CodeError;
|
|
199290
199520
|
}
|
|
199291
199521
|
});
|
|
@@ -199375,16 +199605,16 @@ var require_cookie = __commonJS((exports) => {
|
|
|
199375
199605
|
}
|
|
199376
199606
|
function startIndex(str, index, max) {
|
|
199377
199607
|
do {
|
|
199378
|
-
var
|
|
199379
|
-
if (
|
|
199608
|
+
var code2 = str.charCodeAt(index);
|
|
199609
|
+
if (code2 !== 32 && code2 !== 9)
|
|
199380
199610
|
return index;
|
|
199381
199611
|
} while (++index < max);
|
|
199382
199612
|
return max;
|
|
199383
199613
|
}
|
|
199384
199614
|
function endIndex(str, index, min) {
|
|
199385
199615
|
while (index > min) {
|
|
199386
|
-
var
|
|
199387
|
-
if (
|
|
199616
|
+
var code2 = str.charCodeAt(--index);
|
|
199617
|
+
if (code2 !== 32 && code2 !== 9)
|
|
199388
199618
|
return index + 1;
|
|
199389
199619
|
}
|
|
199390
199620
|
return min;
|
|
@@ -199599,11 +199829,11 @@ var require_response = __commonJS((exports, module) => {
|
|
|
199599
199829
|
var res = Object.create(http3.ServerResponse.prototype);
|
|
199600
199830
|
module.exports = res;
|
|
199601
199831
|
var charsetRegExp = /;\s*charset\s*=/;
|
|
199602
|
-
res.status = function status(
|
|
199603
|
-
if ((typeof
|
|
199604
|
-
deprecate3("res.status(" + JSON.stringify(
|
|
199832
|
+
res.status = function status(code2) {
|
|
199833
|
+
if ((typeof code2 === "string" || Math.floor(code2) !== code2) && code2 > 99 && code2 < 1000) {
|
|
199834
|
+
deprecate3("res.status(" + JSON.stringify(code2) + "): use res.status(" + Math.floor(code2) + ") instead");
|
|
199605
199835
|
}
|
|
199606
|
-
this.statusCode =
|
|
199836
|
+
this.statusCode = code2;
|
|
199607
199837
|
return this;
|
|
199608
199838
|
};
|
|
199609
199839
|
res.links = function(links) {
|
|
@@ -201415,13 +201645,13 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
201415
201645
|
}
|
|
201416
201646
|
return lastValue === null || typeof lastValue === "undefined" ? undefined : String(lastValue).trim();
|
|
201417
201647
|
}
|
|
201418
|
-
function createErrorType(
|
|
201648
|
+
function createErrorType(code2, message, baseClass) {
|
|
201419
201649
|
function CustomError(properties) {
|
|
201420
201650
|
if (isFunction(Error.captureStackTrace)) {
|
|
201421
201651
|
Error.captureStackTrace(this, this.constructor);
|
|
201422
201652
|
}
|
|
201423
201653
|
Object.assign(this, properties || {});
|
|
201424
|
-
this.code =
|
|
201654
|
+
this.code = code2;
|
|
201425
201655
|
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
201426
201656
|
}
|
|
201427
201657
|
CustomError.prototype = new (baseClass || Error);
|
|
@@ -201431,7 +201661,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
201431
201661
|
enumerable: false
|
|
201432
201662
|
},
|
|
201433
201663
|
name: {
|
|
201434
|
-
value: "Error [" +
|
|
201664
|
+
value: "Error [" + code2 + "]",
|
|
201435
201665
|
enumerable: false
|
|
201436
201666
|
}
|
|
201437
201667
|
});
|
|
@@ -201820,9 +202050,9 @@ var require_errors4 = __commonJS((exports) => {
|
|
|
201820
202050
|
})(ERRORS || (exports.ERRORS = ERRORS = {}));
|
|
201821
202051
|
|
|
201822
202052
|
class HttpProxyMiddlewareError extends Error {
|
|
201823
|
-
constructor(message,
|
|
202053
|
+
constructor(message, code2) {
|
|
201824
202054
|
super(message);
|
|
201825
|
-
this.code =
|
|
202055
|
+
this.code = code2;
|
|
201826
202056
|
this.name = this.constructor.name;
|
|
201827
202057
|
if (Error.captureStackTrace) {
|
|
201828
202058
|
Error.captureStackTrace(this, this.constructor);
|
|
@@ -203533,8 +203763,8 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203533
203763
|
CHAR_RIGHT_PARENTHESES,
|
|
203534
203764
|
CHAR_RIGHT_SQUARE_BRACKET
|
|
203535
203765
|
} = require_constants11();
|
|
203536
|
-
var isPathSeparator = (
|
|
203537
|
-
return
|
|
203766
|
+
var isPathSeparator = (code2) => {
|
|
203767
|
+
return code2 === CHAR_FORWARD_SLASH || code2 === CHAR_BACKWARD_SLASH;
|
|
203538
203768
|
};
|
|
203539
203769
|
var depth = (token) => {
|
|
203540
203770
|
if (token.isPrefix !== true) {
|
|
@@ -203564,38 +203794,38 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203564
203794
|
let finished = false;
|
|
203565
203795
|
let braces = 0;
|
|
203566
203796
|
let prev;
|
|
203567
|
-
let
|
|
203797
|
+
let code2;
|
|
203568
203798
|
let token = { value: "", depth: 0, isGlob: false };
|
|
203569
203799
|
const eos = () => index >= length;
|
|
203570
203800
|
const peek = () => str.charCodeAt(index + 1);
|
|
203571
203801
|
const advance = () => {
|
|
203572
|
-
prev =
|
|
203802
|
+
prev = code2;
|
|
203573
203803
|
return str.charCodeAt(++index);
|
|
203574
203804
|
};
|
|
203575
203805
|
while (index < length) {
|
|
203576
|
-
|
|
203806
|
+
code2 = advance();
|
|
203577
203807
|
let next;
|
|
203578
|
-
if (
|
|
203808
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
203579
203809
|
backslashes = token.backslashes = true;
|
|
203580
|
-
|
|
203581
|
-
if (
|
|
203810
|
+
code2 = advance();
|
|
203811
|
+
if (code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
203582
203812
|
braceEscaped = true;
|
|
203583
203813
|
}
|
|
203584
203814
|
continue;
|
|
203585
203815
|
}
|
|
203586
|
-
if (braceEscaped === true ||
|
|
203816
|
+
if (braceEscaped === true || code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
203587
203817
|
braces++;
|
|
203588
|
-
while (eos() !== true && (
|
|
203589
|
-
if (
|
|
203818
|
+
while (eos() !== true && (code2 = advance())) {
|
|
203819
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
203590
203820
|
backslashes = token.backslashes = true;
|
|
203591
203821
|
advance();
|
|
203592
203822
|
continue;
|
|
203593
203823
|
}
|
|
203594
|
-
if (
|
|
203824
|
+
if (code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
203595
203825
|
braces++;
|
|
203596
203826
|
continue;
|
|
203597
203827
|
}
|
|
203598
|
-
if (braceEscaped !== true &&
|
|
203828
|
+
if (braceEscaped !== true && code2 === CHAR_DOT && (code2 = advance()) === CHAR_DOT) {
|
|
203599
203829
|
isBrace = token.isBrace = true;
|
|
203600
203830
|
isGlob = token.isGlob = true;
|
|
203601
203831
|
finished = true;
|
|
@@ -203604,7 +203834,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203604
203834
|
}
|
|
203605
203835
|
break;
|
|
203606
203836
|
}
|
|
203607
|
-
if (braceEscaped !== true &&
|
|
203837
|
+
if (braceEscaped !== true && code2 === CHAR_COMMA) {
|
|
203608
203838
|
isBrace = token.isBrace = true;
|
|
203609
203839
|
isGlob = token.isGlob = true;
|
|
203610
203840
|
finished = true;
|
|
@@ -203613,7 +203843,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203613
203843
|
}
|
|
203614
203844
|
break;
|
|
203615
203845
|
}
|
|
203616
|
-
if (
|
|
203846
|
+
if (code2 === CHAR_RIGHT_CURLY_BRACE) {
|
|
203617
203847
|
braces--;
|
|
203618
203848
|
if (braces === 0) {
|
|
203619
203849
|
braceEscaped = false;
|
|
@@ -203628,7 +203858,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203628
203858
|
}
|
|
203629
203859
|
break;
|
|
203630
203860
|
}
|
|
203631
|
-
if (
|
|
203861
|
+
if (code2 === CHAR_FORWARD_SLASH) {
|
|
203632
203862
|
slashes.push(index);
|
|
203633
203863
|
tokens.push(token);
|
|
203634
203864
|
token = { value: "", depth: 0, isGlob: false };
|
|
@@ -203642,22 +203872,22 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203642
203872
|
continue;
|
|
203643
203873
|
}
|
|
203644
203874
|
if (opts.noext !== true) {
|
|
203645
|
-
const isExtglobChar =
|
|
203875
|
+
const isExtglobChar = code2 === CHAR_PLUS || code2 === CHAR_AT || code2 === CHAR_ASTERISK || code2 === CHAR_QUESTION_MARK || code2 === CHAR_EXCLAMATION_MARK;
|
|
203646
203876
|
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
203647
203877
|
isGlob = token.isGlob = true;
|
|
203648
203878
|
isExtglob = token.isExtglob = true;
|
|
203649
203879
|
finished = true;
|
|
203650
|
-
if (
|
|
203880
|
+
if (code2 === CHAR_EXCLAMATION_MARK && index === start) {
|
|
203651
203881
|
negatedExtglob = true;
|
|
203652
203882
|
}
|
|
203653
203883
|
if (scanToEnd === true) {
|
|
203654
|
-
while (eos() !== true && (
|
|
203655
|
-
if (
|
|
203884
|
+
while (eos() !== true && (code2 = advance())) {
|
|
203885
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
203656
203886
|
backslashes = token.backslashes = true;
|
|
203657
|
-
|
|
203887
|
+
code2 = advance();
|
|
203658
203888
|
continue;
|
|
203659
203889
|
}
|
|
203660
|
-
if (
|
|
203890
|
+
if (code2 === CHAR_RIGHT_PARENTHESES) {
|
|
203661
203891
|
isGlob = token.isGlob = true;
|
|
203662
203892
|
finished = true;
|
|
203663
203893
|
break;
|
|
@@ -203668,7 +203898,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203668
203898
|
break;
|
|
203669
203899
|
}
|
|
203670
203900
|
}
|
|
203671
|
-
if (
|
|
203901
|
+
if (code2 === CHAR_ASTERISK) {
|
|
203672
203902
|
if (prev === CHAR_ASTERISK)
|
|
203673
203903
|
isGlobstar = token.isGlobstar = true;
|
|
203674
203904
|
isGlob = token.isGlob = true;
|
|
@@ -203678,7 +203908,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203678
203908
|
}
|
|
203679
203909
|
break;
|
|
203680
203910
|
}
|
|
203681
|
-
if (
|
|
203911
|
+
if (code2 === CHAR_QUESTION_MARK) {
|
|
203682
203912
|
isGlob = token.isGlob = true;
|
|
203683
203913
|
finished = true;
|
|
203684
203914
|
if (scanToEnd === true) {
|
|
@@ -203686,7 +203916,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203686
203916
|
}
|
|
203687
203917
|
break;
|
|
203688
203918
|
}
|
|
203689
|
-
if (
|
|
203919
|
+
if (code2 === CHAR_LEFT_SQUARE_BRACKET) {
|
|
203690
203920
|
while (eos() !== true && (next = advance())) {
|
|
203691
203921
|
if (next === CHAR_BACKWARD_SLASH) {
|
|
203692
203922
|
backslashes = token.backslashes = true;
|
|
@@ -203705,21 +203935,21 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203705
203935
|
}
|
|
203706
203936
|
break;
|
|
203707
203937
|
}
|
|
203708
|
-
if (opts.nonegate !== true &&
|
|
203938
|
+
if (opts.nonegate !== true && code2 === CHAR_EXCLAMATION_MARK && index === start) {
|
|
203709
203939
|
negated = token.negated = true;
|
|
203710
203940
|
start++;
|
|
203711
203941
|
continue;
|
|
203712
203942
|
}
|
|
203713
|
-
if (opts.noparen !== true &&
|
|
203943
|
+
if (opts.noparen !== true && code2 === CHAR_LEFT_PARENTHESES) {
|
|
203714
203944
|
isGlob = token.isGlob = true;
|
|
203715
203945
|
if (scanToEnd === true) {
|
|
203716
|
-
while (eos() !== true && (
|
|
203717
|
-
if (
|
|
203946
|
+
while (eos() !== true && (code2 = advance())) {
|
|
203947
|
+
if (code2 === CHAR_LEFT_PARENTHESES) {
|
|
203718
203948
|
backslashes = token.backslashes = true;
|
|
203719
|
-
|
|
203949
|
+
code2 = advance();
|
|
203720
203950
|
continue;
|
|
203721
203951
|
}
|
|
203722
|
-
if (
|
|
203952
|
+
if (code2 === CHAR_RIGHT_PARENTHESES) {
|
|
203723
203953
|
finished = true;
|
|
203724
203954
|
break;
|
|
203725
203955
|
}
|
|
@@ -203785,7 +204015,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
203785
204015
|
};
|
|
203786
204016
|
if (opts.tokens === true) {
|
|
203787
204017
|
state.maxDepth = 0;
|
|
203788
|
-
if (!isPathSeparator(
|
|
204018
|
+
if (!isPathSeparator(code2)) {
|
|
203789
204019
|
tokens.push(token);
|
|
203790
204020
|
}
|
|
203791
204021
|
state.tokens = tokens;
|
|
@@ -205854,11 +206084,11 @@ var require_dist4 = __commonJS((exports) => {
|
|
|
205854
206084
|
});
|
|
205855
206085
|
|
|
205856
206086
|
// src/driver_errors.ts
|
|
205857
|
-
function isMysqlConfigFault(
|
|
205858
|
-
return typeof
|
|
206087
|
+
function isMysqlConfigFault(code2) {
|
|
206088
|
+
return typeof code2 === "string" && (MYSQL_CONFIG_CODES.has(code2) || code2.startsWith("HANDSHAKE_"));
|
|
205859
206089
|
}
|
|
205860
|
-
function isSqlserverConnectTimeout(error,
|
|
205861
|
-
return
|
|
206090
|
+
function isSqlserverConnectTimeout(error, code2) {
|
|
206091
|
+
return code2 === "ETIMEOUT" && error.name === "ConnectionError";
|
|
205862
206092
|
}
|
|
205863
206093
|
function wrappedError(error) {
|
|
205864
206094
|
if (error.cause instanceof Error)
|
|
@@ -205868,8 +206098,8 @@ function wrappedError(error) {
|
|
|
205868
206098
|
function causeChainHasTlsVerificationFailure(error) {
|
|
205869
206099
|
let current = wrappedError(error);
|
|
205870
206100
|
for (let depth = 0;depth < 8 && current instanceof Error; depth++) {
|
|
205871
|
-
const { code } = current;
|
|
205872
|
-
if (typeof
|
|
206101
|
+
const { code: code2 } = current;
|
|
206102
|
+
if (typeof code2 === "string" && TLS_VERIFICATION_CODES.has(code2)) {
|
|
205873
206103
|
return true;
|
|
205874
206104
|
}
|
|
205875
206105
|
current = wrappedError(current);
|
|
@@ -205878,17 +206108,17 @@ function causeChainHasTlsVerificationFailure(error) {
|
|
|
205878
206108
|
}
|
|
205879
206109
|
function isConnectionFailure(error) {
|
|
205880
206110
|
for (const current of causeChain(error)) {
|
|
205881
|
-
const { code, fatal } = current;
|
|
205882
|
-
if (typeof
|
|
205883
|
-
if (NODE_CONNECTION_CODES.has(
|
|
206111
|
+
const { code: code2, fatal } = current;
|
|
206112
|
+
if (typeof code2 === "string") {
|
|
206113
|
+
if (NODE_CONNECTION_CODES.has(code2))
|
|
205884
206114
|
return true;
|
|
205885
|
-
if (POSTGRES_CONNECTION_SQLSTATE.test(
|
|
206115
|
+
if (POSTGRES_CONNECTION_SQLSTATE.test(code2))
|
|
205886
206116
|
return true;
|
|
205887
|
-
if (SQLSERVER_CONNECTION_CODES.has(
|
|
206117
|
+
if (SQLSERVER_CONNECTION_CODES.has(code2) || isSqlserverConnectTimeout(current, code2)) {
|
|
205888
206118
|
return !causeChainHasTlsVerificationFailure(current);
|
|
205889
206119
|
}
|
|
205890
206120
|
}
|
|
205891
|
-
if (fatal === true && !isMysqlConfigFault(
|
|
206121
|
+
if (fatal === true && !isMysqlConfigFault(code2))
|
|
205892
206122
|
return true;
|
|
205893
206123
|
const message = current.message.trim();
|
|
205894
206124
|
if (CODELESS_CONNECTION_MESSAGES.some((re) => re.test(message))) {
|
|
@@ -205906,9 +206136,9 @@ function* causeChain(error) {
|
|
|
205906
206136
|
}
|
|
205907
206137
|
function isCredentialRejection(error) {
|
|
205908
206138
|
for (const current of causeChain(error)) {
|
|
205909
|
-
const { code } = current;
|
|
205910
|
-
if (typeof
|
|
205911
|
-
const value = String(
|
|
206139
|
+
const { code: code2 } = current;
|
|
206140
|
+
if (typeof code2 === "string" || typeof code2 === "number") {
|
|
206141
|
+
const value = String(code2);
|
|
205912
206142
|
if (POSTGRES_AUTH_SQLSTATE.test(value))
|
|
205913
206143
|
return true;
|
|
205914
206144
|
if (MYSQL_AUTH_CODES.has(value))
|
|
@@ -206103,21 +206333,21 @@ function databaseAccessFailure(error) {
|
|
|
206103
206333
|
}
|
|
206104
206334
|
function statementRejection(error) {
|
|
206105
206335
|
for (const current of causeChain(error)) {
|
|
206106
|
-
const { code, severity } = current;
|
|
206336
|
+
const { code: code2, severity } = current;
|
|
206107
206337
|
if (severity === "FATAL" || severity === "PANIC")
|
|
206108
206338
|
return;
|
|
206109
|
-
if (typeof
|
|
206339
|
+
if (typeof code2 !== "string" || !POSTGRES_STATEMENT_SQLSTATES.has(code2)) {
|
|
206110
206340
|
continue;
|
|
206111
206341
|
}
|
|
206112
206342
|
const message = current.message;
|
|
206113
|
-
return
|
|
206343
|
+
return code2 === POSTGRES_UNDEFINED_TABLE && POSTGRES_RELATION_MISSING.test(message) ? new TableNotFoundError(message) : new InvalidArgumentError(message);
|
|
206114
206344
|
}
|
|
206115
206345
|
return;
|
|
206116
206346
|
}
|
|
206117
206347
|
function describeFilesystemAccessFailure(errno) {
|
|
206118
|
-
const
|
|
206348
|
+
const code2 = errno.code ?? "";
|
|
206119
206349
|
const target = errno.path ? ` '${errno.path}'` : "";
|
|
206120
|
-
return `${
|
|
206350
|
+
return `${code2}: ${FILESYSTEM_ACCESS_DESCRIPTIONS[code2] ?? code2}, ${errno.syscall}${target}`;
|
|
206121
206351
|
}
|
|
206122
206352
|
function messageWithFilesystemCause(error) {
|
|
206123
206353
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -206127,11 +206357,11 @@ function messageWithFilesystemCause(error) {
|
|
|
206127
206357
|
return `${message}: ${describeFilesystemAccessFailure(access2)}`;
|
|
206128
206358
|
}
|
|
206129
206359
|
function errnoWireFields(error) {
|
|
206130
|
-
const { code, syscall, path: path4 } = error;
|
|
206131
|
-
if (typeof
|
|
206360
|
+
const { code: code2, syscall, path: path4 } = error;
|
|
206361
|
+
if (typeof code2 !== "string")
|
|
206132
206362
|
return;
|
|
206133
206363
|
return {
|
|
206134
|
-
code,
|
|
206364
|
+
code: code2,
|
|
206135
206365
|
...typeof syscall === "string" ? { syscall } : {},
|
|
206136
206366
|
...typeof path4 === "string" ? { path: path4 } : {}
|
|
206137
206367
|
};
|
|
@@ -206245,11 +206475,11 @@ function internalErrorToHttpError(error, { log = true, onLogged } = {}) {
|
|
|
206245
206475
|
return httpError(500, GENERIC_INTERNAL_MESSAGE);
|
|
206246
206476
|
}
|
|
206247
206477
|
}
|
|
206248
|
-
function httpError(
|
|
206478
|
+
function httpError(code2, message, reason) {
|
|
206249
206479
|
return {
|
|
206250
|
-
status:
|
|
206480
|
+
status: code2,
|
|
206251
206481
|
json: {
|
|
206252
|
-
code,
|
|
206482
|
+
code: code2,
|
|
206253
206483
|
message,
|
|
206254
206484
|
...reason ? { reason } : {}
|
|
206255
206485
|
}
|
|
@@ -207531,15 +207761,15 @@ ${note.body}`;
|
|
|
207531
207761
|
lineRun.endLine = note.endLine;
|
|
207532
207762
|
return;
|
|
207533
207763
|
}
|
|
207534
|
-
const
|
|
207764
|
+
const cell2 = {
|
|
207535
207765
|
kind: "markdown",
|
|
207536
207766
|
type: "markdown",
|
|
207537
207767
|
text: note.body,
|
|
207538
207768
|
startLine: note.startLine,
|
|
207539
207769
|
endLine: note.endLine
|
|
207540
207770
|
};
|
|
207541
|
-
cells.push(
|
|
207542
|
-
lineRun = note.block ? undefined :
|
|
207771
|
+
cells.push(cell2);
|
|
207772
|
+
lineRun = note.block ? undefined : cell2;
|
|
207543
207773
|
});
|
|
207544
207774
|
return { cells, annotations };
|
|
207545
207775
|
}
|
|
@@ -211049,7 +211279,7 @@ function carriesCeilingLeaks(prepared, isListed) {
|
|
|
211049
211279
|
query: query2,
|
|
211050
211280
|
modelDef
|
|
211051
211281
|
}));
|
|
211052
|
-
cells.forEach((
|
|
211282
|
+
cells.forEach((cell2, i2) => queries.push({ label: `notebook cell ${i2 + 1}`, ...cell2 }));
|
|
211053
211283
|
for (const { label, query: query2, modelDef: def } of queries) {
|
|
211054
211284
|
const refusal = ceilingRefusal(def, query2);
|
|
211055
211285
|
if (refusal)
|
|
@@ -221631,13 +221861,13 @@ var require_follow_redirects2 = __commonJS((exports, module) => {
|
|
|
221631
221861
|
}
|
|
221632
221862
|
return lastValue === null || typeof lastValue === "undefined" ? undefined : String(lastValue).trim();
|
|
221633
221863
|
}
|
|
221634
|
-
function createErrorType(
|
|
221864
|
+
function createErrorType(code2, message, baseClass) {
|
|
221635
221865
|
function CustomError(properties) {
|
|
221636
221866
|
if (isFunction(Error.captureStackTrace)) {
|
|
221637
221867
|
Error.captureStackTrace(this, this.constructor);
|
|
221638
221868
|
}
|
|
221639
221869
|
Object.assign(this, properties || {});
|
|
221640
|
-
this.code =
|
|
221870
|
+
this.code = code2;
|
|
221641
221871
|
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
221642
221872
|
}
|
|
221643
221873
|
CustomError.prototype = new (baseClass || Error);
|
|
@@ -221647,7 +221877,7 @@ var require_follow_redirects2 = __commonJS((exports, module) => {
|
|
|
221647
221877
|
enumerable: false
|
|
221648
221878
|
},
|
|
221649
221879
|
name: {
|
|
221650
|
-
value: "Error [" +
|
|
221880
|
+
value: "Error [" + code2 + "]",
|
|
221651
221881
|
enumerable: false
|
|
221652
221882
|
}
|
|
221653
221883
|
});
|
|
@@ -222303,15 +222533,15 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
222303
222533
|
let start = 0;
|
|
222304
222534
|
let end = str.length;
|
|
222305
222535
|
while (start < end) {
|
|
222306
|
-
const
|
|
222307
|
-
if (
|
|
222536
|
+
const code2 = str.charCodeAt(start);
|
|
222537
|
+
if (code2 !== 9 && code2 !== 32) {
|
|
222308
222538
|
break;
|
|
222309
222539
|
}
|
|
222310
222540
|
start += 1;
|
|
222311
222541
|
}
|
|
222312
222542
|
while (end > start) {
|
|
222313
|
-
const
|
|
222314
|
-
if (
|
|
222543
|
+
const code2 = str.charCodeAt(end - 1);
|
|
222544
|
+
if (code2 !== 9 && code2 !== 32) {
|
|
222315
222545
|
break;
|
|
222316
222546
|
}
|
|
222317
222547
|
end -= 1;
|
|
@@ -222359,15 +222589,15 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
222359
222589
|
let start = 0;
|
|
222360
222590
|
let end = value.length;
|
|
222361
222591
|
while (start < end) {
|
|
222362
|
-
const
|
|
222363
|
-
if (
|
|
222592
|
+
const code2 = value.charCodeAt(start);
|
|
222593
|
+
if (code2 !== 9 && code2 !== 32) {
|
|
222364
222594
|
break;
|
|
222365
222595
|
}
|
|
222366
222596
|
start += 1;
|
|
222367
222597
|
}
|
|
222368
222598
|
while (end > start) {
|
|
222369
|
-
const
|
|
222370
|
-
if (
|
|
222599
|
+
const code2 = value.charCodeAt(end - 1);
|
|
222600
|
+
if (code2 !== 9 && code2 !== 32) {
|
|
222371
222601
|
break;
|
|
222372
222602
|
}
|
|
222373
222603
|
end -= 1;
|
|
@@ -222381,11 +222611,11 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
222381
222611
|
}
|
|
222382
222612
|
let decoded = "";
|
|
222383
222613
|
for (let i2 = 1;i2 < last; i2++) {
|
|
222384
|
-
const
|
|
222385
|
-
if (
|
|
222614
|
+
const code2 = value.charCodeAt(i2);
|
|
222615
|
+
if (code2 === 34) {
|
|
222386
222616
|
return value;
|
|
222387
222617
|
}
|
|
222388
|
-
if (
|
|
222618
|
+
if (code2 === 92) {
|
|
222389
222619
|
i2 += 1;
|
|
222390
222620
|
if (i2 >= last) {
|
|
222391
222621
|
return value;
|
|
@@ -222419,18 +222649,18 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
222419
222649
|
parameters[normalizedName] = decodeQuotedString(parameterValue);
|
|
222420
222650
|
}
|
|
222421
222651
|
for (let i2 = 0;i2 < str.length; i2++) {
|
|
222422
|
-
const
|
|
222652
|
+
const code2 = str.charCodeAt(i2);
|
|
222423
222653
|
if (quoted) {
|
|
222424
222654
|
if (escaped) {
|
|
222425
222655
|
escaped = false;
|
|
222426
|
-
} else if (
|
|
222656
|
+
} else if (code2 === 92) {
|
|
222427
222657
|
escaped = true;
|
|
222428
|
-
} else if (
|
|
222658
|
+
} else if (code2 === 34) {
|
|
222429
222659
|
quoted = false;
|
|
222430
222660
|
}
|
|
222431
|
-
} else if (
|
|
222661
|
+
} else if (code2 === 34) {
|
|
222432
222662
|
quoted = true;
|
|
222433
|
-
} else if (
|
|
222663
|
+
} else if (code2 === 44 || code2 === 59) {
|
|
222434
222664
|
parseParameter(i2);
|
|
222435
222665
|
start = i2 + 1;
|
|
222436
222666
|
}
|
|
@@ -222735,12 +222965,12 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
222735
222965
|
}
|
|
222736
222966
|
|
|
222737
222967
|
class AxiosError extends Error {
|
|
222738
|
-
static from(error,
|
|
222968
|
+
static from(error, code2, config, request, response, customProps) {
|
|
222739
222969
|
let message = error.message;
|
|
222740
222970
|
if (!message && utils$1.isArray(error.errors) && error.errors.length) {
|
|
222741
222971
|
message = aggregateErrorMessage(error);
|
|
222742
222972
|
}
|
|
222743
|
-
const axiosError = new AxiosError(message,
|
|
222973
|
+
const axiosError = new AxiosError(message, code2 || error.code, config, request, response);
|
|
222744
222974
|
Object.defineProperty(axiosError, "cause", {
|
|
222745
222975
|
__proto__: null,
|
|
222746
222976
|
value: error,
|
|
@@ -222755,7 +222985,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
222755
222985
|
customProps && Object.assign(axiosError, customProps);
|
|
222756
222986
|
return axiosError;
|
|
222757
222987
|
}
|
|
222758
|
-
constructor(message,
|
|
222988
|
+
constructor(message, code2, config, request, response) {
|
|
222759
222989
|
super(message);
|
|
222760
222990
|
Object.defineProperty(this, "message", {
|
|
222761
222991
|
__proto__: null,
|
|
@@ -222766,7 +222996,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
222766
222996
|
});
|
|
222767
222997
|
this.name = "AxiosError";
|
|
222768
222998
|
this.isAxiosError = true;
|
|
222769
|
-
|
|
222999
|
+
code2 && (this.code = code2);
|
|
222770
223000
|
config && (this.config = config);
|
|
222771
223001
|
request && (this.request = request);
|
|
222772
223002
|
if (response) {
|
|
@@ -224358,19 +224588,19 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
224358
224588
|
let padding = 0;
|
|
224359
224589
|
let invalid = false;
|
|
224360
224590
|
for (let i2 = 0;i2 < len; i2++) {
|
|
224361
|
-
let
|
|
224362
|
-
if (
|
|
224363
|
-
|
|
224591
|
+
let code2 = body.charCodeAt(i2);
|
|
224592
|
+
if (code2 === 37 && isPercentEncodedByte(body, i2, len)) {
|
|
224593
|
+
code2 = hexValue(body.charCodeAt(i2 + 1)) * 16 + hexValue(body.charCodeAt(i2 + 2));
|
|
224364
224594
|
i2 += 2;
|
|
224365
224595
|
}
|
|
224366
|
-
if (isBase64Whitespace(
|
|
224596
|
+
if (isBase64Whitespace(code2)) {
|
|
224367
224597
|
continue;
|
|
224368
224598
|
}
|
|
224369
|
-
if (
|
|
224599
|
+
if (code2 === 61) {
|
|
224370
224600
|
padding++;
|
|
224371
224601
|
continue;
|
|
224372
224602
|
}
|
|
224373
|
-
if (!isBase64Char(
|
|
224603
|
+
if (!isBase64Char(code2) || padding > 0) {
|
|
224374
224604
|
invalid = true;
|
|
224375
224605
|
continue;
|
|
224376
224606
|
}
|
|
@@ -229634,15 +229864,15 @@ function trimSPorHTAB(str) {
|
|
|
229634
229864
|
let start = 0;
|
|
229635
229865
|
let end = str.length;
|
|
229636
229866
|
while (start < end) {
|
|
229637
|
-
const
|
|
229638
|
-
if (
|
|
229867
|
+
const code2 = str.charCodeAt(start);
|
|
229868
|
+
if (code2 !== 9 && code2 !== 32) {
|
|
229639
229869
|
break;
|
|
229640
229870
|
}
|
|
229641
229871
|
start += 1;
|
|
229642
229872
|
}
|
|
229643
229873
|
while (end > start) {
|
|
229644
|
-
const
|
|
229645
|
-
if (
|
|
229874
|
+
const code2 = str.charCodeAt(end - 1);
|
|
229875
|
+
if (code2 !== 9 && code2 !== 32) {
|
|
229646
229876
|
break;
|
|
229647
229877
|
}
|
|
229648
229878
|
end -= 1;
|
|
@@ -229692,15 +229922,15 @@ function trimOWS(value) {
|
|
|
229692
229922
|
let start = 0;
|
|
229693
229923
|
let end = value.length;
|
|
229694
229924
|
while (start < end) {
|
|
229695
|
-
const
|
|
229696
|
-
if (
|
|
229925
|
+
const code2 = value.charCodeAt(start);
|
|
229926
|
+
if (code2 !== 9 && code2 !== 32) {
|
|
229697
229927
|
break;
|
|
229698
229928
|
}
|
|
229699
229929
|
start += 1;
|
|
229700
229930
|
}
|
|
229701
229931
|
while (end > start) {
|
|
229702
|
-
const
|
|
229703
|
-
if (
|
|
229932
|
+
const code2 = value.charCodeAt(end - 1);
|
|
229933
|
+
if (code2 !== 9 && code2 !== 32) {
|
|
229704
229934
|
break;
|
|
229705
229935
|
}
|
|
229706
229936
|
end -= 1;
|
|
@@ -229714,11 +229944,11 @@ function decodeQuotedString(value) {
|
|
|
229714
229944
|
}
|
|
229715
229945
|
let decoded = "";
|
|
229716
229946
|
for (let i2 = 1;i2 < last; i2++) {
|
|
229717
|
-
const
|
|
229718
|
-
if (
|
|
229947
|
+
const code2 = value.charCodeAt(i2);
|
|
229948
|
+
if (code2 === 34) {
|
|
229719
229949
|
return value;
|
|
229720
229950
|
}
|
|
229721
|
-
if (
|
|
229951
|
+
if (code2 === 92) {
|
|
229722
229952
|
i2 += 1;
|
|
229723
229953
|
if (i2 >= last) {
|
|
229724
229954
|
return value;
|
|
@@ -229752,18 +229982,18 @@ function parseParameters(value) {
|
|
|
229752
229982
|
parameters[normalizedName] = decodeQuotedString(parameterValue);
|
|
229753
229983
|
}
|
|
229754
229984
|
for (let i2 = 0;i2 < str.length; i2++) {
|
|
229755
|
-
const
|
|
229985
|
+
const code2 = str.charCodeAt(i2);
|
|
229756
229986
|
if (quoted) {
|
|
229757
229987
|
if (escaped) {
|
|
229758
229988
|
escaped = false;
|
|
229759
|
-
} else if (
|
|
229989
|
+
} else if (code2 === 92) {
|
|
229760
229990
|
escaped = true;
|
|
229761
|
-
} else if (
|
|
229991
|
+
} else if (code2 === 34) {
|
|
229762
229992
|
quoted = false;
|
|
229763
229993
|
}
|
|
229764
|
-
} else if (
|
|
229994
|
+
} else if (code2 === 34) {
|
|
229765
229995
|
quoted = true;
|
|
229766
|
-
} else if (
|
|
229996
|
+
} else if (code2 === 44 || code2 === 59) {
|
|
229767
229997
|
parseParameter(i2);
|
|
229768
229998
|
start = i2 + 1;
|
|
229769
229999
|
}
|
|
@@ -230084,12 +230314,12 @@ var init_AxiosError = __esm(() => {
|
|
|
230084
230314
|
init_utils();
|
|
230085
230315
|
init_AxiosHeaders();
|
|
230086
230316
|
AxiosError = class AxiosError extends Error {
|
|
230087
|
-
static from(error,
|
|
230317
|
+
static from(error, code2, config, request, response, customProps) {
|
|
230088
230318
|
let message = error.message;
|
|
230089
230319
|
if (!message && utils_default.isArray(error.errors) && error.errors.length) {
|
|
230090
230320
|
message = aggregateErrorMessage(error);
|
|
230091
230321
|
}
|
|
230092
|
-
const axiosError = new AxiosError(message,
|
|
230322
|
+
const axiosError = new AxiosError(message, code2 || error.code, config, request, response);
|
|
230093
230323
|
Object.defineProperty(axiosError, "cause", {
|
|
230094
230324
|
__proto__: null,
|
|
230095
230325
|
value: error,
|
|
@@ -230104,7 +230334,7 @@ var init_AxiosError = __esm(() => {
|
|
|
230104
230334
|
customProps && Object.assign(axiosError, customProps);
|
|
230105
230335
|
return axiosError;
|
|
230106
230336
|
}
|
|
230107
|
-
constructor(message,
|
|
230337
|
+
constructor(message, code2, config, request, response) {
|
|
230108
230338
|
super(message);
|
|
230109
230339
|
Object.defineProperty(this, "message", {
|
|
230110
230340
|
__proto__: null,
|
|
@@ -230115,7 +230345,7 @@ var init_AxiosError = __esm(() => {
|
|
|
230115
230345
|
});
|
|
230116
230346
|
this.name = "AxiosError";
|
|
230117
230347
|
this.isAxiosError = true;
|
|
230118
|
-
|
|
230348
|
+
code2 && (this.code = code2);
|
|
230119
230349
|
config && (this.config = config);
|
|
230120
230350
|
request && (this.request = request);
|
|
230121
230351
|
if (response) {
|
|
@@ -231913,19 +232143,19 @@ var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 6
|
|
|
231913
232143
|
let padding = 0;
|
|
231914
232144
|
let invalid = false;
|
|
231915
232145
|
for (let i2 = 0;i2 < len; i2++) {
|
|
231916
|
-
let
|
|
231917
|
-
if (
|
|
231918
|
-
|
|
232146
|
+
let code2 = body.charCodeAt(i2);
|
|
232147
|
+
if (code2 === 37 && isPercentEncodedByte(body, i2, len)) {
|
|
232148
|
+
code2 = hexValue(body.charCodeAt(i2 + 1)) * 16 + hexValue(body.charCodeAt(i2 + 2));
|
|
231919
232149
|
i2 += 2;
|
|
231920
232150
|
}
|
|
231921
|
-
if (isBase64Whitespace(
|
|
232151
|
+
if (isBase64Whitespace(code2)) {
|
|
231922
232152
|
continue;
|
|
231923
232153
|
}
|
|
231924
|
-
if (
|
|
232154
|
+
if (code2 === 61) {
|
|
231925
232155
|
padding++;
|
|
231926
232156
|
continue;
|
|
231927
232157
|
}
|
|
231928
|
-
if (!isBase64Char(
|
|
232158
|
+
if (!isBase64Char(code2) || padding > 0) {
|
|
231929
232159
|
invalid = true;
|
|
231930
232160
|
continue;
|
|
231931
232161
|
}
|
|
@@ -236105,8 +236335,8 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
236105
236335
|
abortSignal.onabort = onAbort;
|
|
236106
236336
|
}
|
|
236107
236337
|
}
|
|
236108
|
-
req.on("frameError", (type,
|
|
236109
|
-
rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${
|
|
236338
|
+
req.on("frameError", (type, code2, id) => {
|
|
236339
|
+
rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code2}.`));
|
|
236110
236340
|
});
|
|
236111
236341
|
req.on("error", rejectWithDestroy);
|
|
236112
236342
|
req.on("aborted", () => {
|
|
@@ -240662,12 +240892,12 @@ var require_dist_cjs20 = __commonJS((exports) => {
|
|
|
240662
240892
|
}
|
|
240663
240893
|
let len = body.length;
|
|
240664
240894
|
for (let i2 = len - 1;i2 >= 0; i2--) {
|
|
240665
|
-
const
|
|
240666
|
-
if (
|
|
240895
|
+
const code2 = body.charCodeAt(i2);
|
|
240896
|
+
if (code2 > 127 && code2 <= 2047)
|
|
240667
240897
|
len++;
|
|
240668
|
-
else if (
|
|
240898
|
+
else if (code2 > 2047 && code2 <= 65535)
|
|
240669
240899
|
len += 2;
|
|
240670
|
-
if (
|
|
240900
|
+
if (code2 >= 56320 && code2 <= 57343)
|
|
240671
240901
|
i2--;
|
|
240672
240902
|
}
|
|
240673
240903
|
return len;
|
|
@@ -246374,9 +246604,9 @@ More information can be found at: https://a.co/c895JFp`);
|
|
|
246374
246604
|
}, output), dataObject);
|
|
246375
246605
|
}
|
|
246376
246606
|
loadQueryErrorCode(output, data) {
|
|
246377
|
-
const
|
|
246378
|
-
if (
|
|
246379
|
-
return
|
|
246607
|
+
const code2 = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code;
|
|
246608
|
+
if (code2 !== undefined) {
|
|
246609
|
+
return code2;
|
|
246380
246610
|
}
|
|
246381
246611
|
if (output.statusCode == 404) {
|
|
246382
246612
|
return "NotFound";
|
|
@@ -254831,9 +255061,9 @@ var require_protocols2 = __commonJS((exports) => {
|
|
|
254831
255061
|
}, output), dataObject);
|
|
254832
255062
|
}
|
|
254833
255063
|
loadQueryErrorCode(output, data) {
|
|
254834
|
-
const
|
|
254835
|
-
if (
|
|
254836
|
-
return
|
|
255064
|
+
const code2 = (data.Errors?.[0]?.Error ?? data.Errors?.Error ?? data.Error)?.Code;
|
|
255065
|
+
if (code2 !== undefined) {
|
|
255066
|
+
return code2;
|
|
254837
255067
|
}
|
|
254838
255068
|
if (output.statusCode == 404) {
|
|
254839
255069
|
return "NotFound";
|
|
@@ -260194,15 +260424,15 @@ var require_dist_cjs69 = __commonJS((exports) => {
|
|
|
260194
260424
|
unmodeledError.name = message.headers[":error-code"].value;
|
|
260195
260425
|
throw unmodeledError;
|
|
260196
260426
|
} else if (messageType === "exception") {
|
|
260197
|
-
const
|
|
260198
|
-
const exception = { [
|
|
260427
|
+
const code2 = message.headers[":exception-type"].value;
|
|
260428
|
+
const exception = { [code2]: message };
|
|
260199
260429
|
const deserializedException = await deserializer(exception);
|
|
260200
260430
|
if (deserializedException.$unknown) {
|
|
260201
260431
|
const error = new Error(toUtf8(message.body));
|
|
260202
|
-
error.name =
|
|
260432
|
+
error.name = code2;
|
|
260203
260433
|
throw error;
|
|
260204
260434
|
}
|
|
260205
|
-
throw deserializedException[
|
|
260435
|
+
throw deserializedException[code2];
|
|
260206
260436
|
} else if (messageType === "event") {
|
|
260207
260437
|
const event = {
|
|
260208
260438
|
[message.headers[":event-type"].value]: message
|
|
@@ -276597,10 +276827,10 @@ var require_agent2 = __commonJS((exports, module) => {
|
|
|
276597
276827
|
error = err;
|
|
276598
276828
|
cb(error);
|
|
276599
276829
|
});
|
|
276600
|
-
proc.on("close", (
|
|
276830
|
+
proc.on("close", (code2) => {
|
|
276601
276831
|
this.proc = undefined;
|
|
276602
276832
|
if (!error) {
|
|
276603
|
-
if (error = ERROR[
|
|
276833
|
+
if (error = ERROR[code2])
|
|
276604
276834
|
return cb(error);
|
|
276605
276835
|
cb();
|
|
276606
276836
|
}
|
|
@@ -277226,11 +277456,11 @@ var require_zlib = __commonJS((exports, module) => {
|
|
|
277226
277456
|
function processCallback() {
|
|
277227
277457
|
throw new Error("Should not get here");
|
|
277228
277458
|
}
|
|
277229
|
-
function zlibOnError(message, errno,
|
|
277459
|
+
function zlibOnError(message, errno, code2) {
|
|
277230
277460
|
const self2 = this._owner;
|
|
277231
277461
|
const error = new Error(message);
|
|
277232
277462
|
error.errno = errno;
|
|
277233
|
-
error.code =
|
|
277463
|
+
error.code = code2;
|
|
277234
277464
|
self2._err = error;
|
|
277235
277465
|
}
|
|
277236
277466
|
function _close(engine) {
|
|
@@ -282411,11 +282641,11 @@ var require_SFTP = __commonJS((exports, module) => {
|
|
|
282411
282641
|
const isBuffered = sendOrBuffer(this, buf);
|
|
282412
282642
|
this._debug && this._debug(`SFTP: Outbound: ${isBuffered ? "Buffered" : "Sending"} HANDLE`);
|
|
282413
282643
|
}
|
|
282414
|
-
status(reqid,
|
|
282644
|
+
status(reqid, code2, message) {
|
|
282415
282645
|
if (!this.server)
|
|
282416
282646
|
throw new Error("Server-only method called in client mode");
|
|
282417
|
-
if (!VALID_STATUS_CODES.has(
|
|
282418
|
-
throw new Error(`Bad status code: ${
|
|
282647
|
+
if (!VALID_STATUS_CODES.has(code2))
|
|
282648
|
+
throw new Error(`Bad status code: ${code2}`);
|
|
282419
282649
|
message || (message = "");
|
|
282420
282650
|
const msgLen = Buffer.byteLength(message);
|
|
282421
282651
|
let p = 9;
|
|
@@ -282423,7 +282653,7 @@ var require_SFTP = __commonJS((exports, module) => {
|
|
|
282423
282653
|
writeUInt32BE(buf, buf.length - 4, 0);
|
|
282424
282654
|
buf[4] = RESPONSE.STATUS;
|
|
282425
282655
|
writeUInt32BE(buf, reqid, 5);
|
|
282426
|
-
writeUInt32BE(buf,
|
|
282656
|
+
writeUInt32BE(buf, code2, p);
|
|
282427
282657
|
writeUInt32BE(buf, msgLen, p += 4);
|
|
282428
282658
|
p += 4;
|
|
282429
282659
|
if (msgLen) {
|
|
@@ -285681,17 +285911,17 @@ var require_client4 = __commonJS((exports, module) => {
|
|
|
285681
285911
|
removeListeners();
|
|
285682
285912
|
cb(err3);
|
|
285683
285913
|
}
|
|
285684
|
-
function onExit(
|
|
285914
|
+
function onExit(code2, signal) {
|
|
285685
285915
|
removeListeners();
|
|
285686
285916
|
let msg;
|
|
285687
|
-
if (typeof
|
|
285688
|
-
msg = `Received exit code ${
|
|
285917
|
+
if (typeof code2 === "number")
|
|
285918
|
+
msg = `Received exit code ${code2} while establishing SFTP session`;
|
|
285689
285919
|
else if (signal !== undefined)
|
|
285690
285920
|
msg = `Received signal ${signal} while establishing SFTP session`;
|
|
285691
285921
|
else
|
|
285692
285922
|
msg = "Received unexpected SFTP session termination";
|
|
285693
285923
|
const err3 = new Error(msg);
|
|
285694
|
-
err3.code =
|
|
285924
|
+
err3.code = code2;
|
|
285695
285925
|
err3.signal = signal;
|
|
285696
285926
|
cb(err3);
|
|
285697
285927
|
}
|
|
@@ -287947,8 +288177,8 @@ var init_query_metadata_metrics = __esm(() => {
|
|
|
287947
288177
|
import * as crypto3 from "node:crypto";
|
|
287948
288178
|
function isRenderableValue(value) {
|
|
287949
288179
|
for (let i2 = 0;i2 < value.length; i2++) {
|
|
287950
|
-
const
|
|
287951
|
-
if (
|
|
288180
|
+
const code2 = value.charCodeAt(i2);
|
|
288181
|
+
if (code2 < 32 || code2 > 126 || code2 === 34)
|
|
287952
288182
|
return false;
|
|
287953
288183
|
}
|
|
287954
288184
|
return true;
|
|
@@ -288024,8 +288254,8 @@ function queryContextProperties(context) {
|
|
|
288024
288254
|
function sanitizeValue2(value) {
|
|
288025
288255
|
let out = "";
|
|
288026
288256
|
for (let i2 = 0;i2 < value.length && out.length < MAX_PROPERTY_VALUE_LENGTH; i2++) {
|
|
288027
|
-
const
|
|
288028
|
-
out +=
|
|
288257
|
+
const code2 = value.charCodeAt(i2);
|
|
288258
|
+
out += code2 < 32 || code2 > 126 || code2 === 34 ? "_" : value[i2];
|
|
288029
288259
|
}
|
|
288030
288260
|
return out;
|
|
288031
288261
|
}
|
|
@@ -291895,8 +292125,8 @@ var require_lib8 = __commonJS((exports, module) => {
|
|
|
291895
292125
|
stream4.end();
|
|
291896
292126
|
}
|
|
291897
292127
|
}
|
|
291898
|
-
fetch3.isRedirect = function(
|
|
291899
|
-
return
|
|
292128
|
+
fetch3.isRedirect = function(code2) {
|
|
292129
|
+
return code2 === 301 || code2 === 302 || code2 === 303 || code2 === 307 || code2 === 308;
|
|
291900
292130
|
};
|
|
291901
292131
|
fetch3.Promise = global.Promise;
|
|
291902
292132
|
module.exports = exports = fetch3;
|
|
@@ -294207,10 +294437,10 @@ var require_src134 = __commonJS((exports) => {
|
|
|
294207
294437
|
"ENOTFOUND",
|
|
294208
294438
|
"ECONNREFUSED"
|
|
294209
294439
|
].includes(err.code))) {
|
|
294210
|
-
let
|
|
294440
|
+
let code2 = "UNKNOWN";
|
|
294211
294441
|
if (err.code)
|
|
294212
|
-
|
|
294213
|
-
process.emitWarning(`received unexpected error = ${err.message} code = ${
|
|
294442
|
+
code2 = err.code;
|
|
294443
|
+
process.emitWarning(`received unexpected error = ${err.message} code = ${code2}`, "MetadataLookupWarning");
|
|
294214
294444
|
}
|
|
294215
294445
|
return false;
|
|
294216
294446
|
}
|
|
@@ -294243,10 +294473,10 @@ var require_base64_js = __commonJS((exports) => {
|
|
|
294243
294473
|
var lookup = [];
|
|
294244
294474
|
var revLookup = [];
|
|
294245
294475
|
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
294246
|
-
var
|
|
294247
|
-
for (i2 = 0, len =
|
|
294248
|
-
lookup[i2] =
|
|
294249
|
-
revLookup[
|
|
294476
|
+
var code2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
294477
|
+
for (i2 = 0, len = code2.length;i2 < len; ++i2) {
|
|
294478
|
+
lookup[i2] = code2[i2];
|
|
294479
|
+
revLookup[code2.charCodeAt(i2)] = i2;
|
|
294250
294480
|
}
|
|
294251
294481
|
var i2;
|
|
294252
294482
|
var len;
|
|
@@ -296322,9 +296552,9 @@ var require_src135 = __commonJS((exports) => {
|
|
|
296322
296552
|
var GOOGLE_REVOKE_TOKEN_URL = "https://accounts.google.com/o/oauth2/revoke?token=";
|
|
296323
296553
|
|
|
296324
296554
|
class ErrorWithCode extends Error {
|
|
296325
|
-
constructor(message,
|
|
296555
|
+
constructor(message, code2) {
|
|
296326
296556
|
super(message);
|
|
296327
|
-
this.code =
|
|
296557
|
+
this.code = code2;
|
|
296328
296558
|
}
|
|
296329
296559
|
}
|
|
296330
296560
|
|
|
@@ -298126,9 +298356,9 @@ var require_pluggable_auth_handler = __commonJS((exports) => {
|
|
|
298126
298356
|
child.kill();
|
|
298127
298357
|
return reject2(new Error("The executable failed to finish within the timeout specified."));
|
|
298128
298358
|
}, this.timeoutMillis);
|
|
298129
|
-
child.on("close", (
|
|
298359
|
+
child.on("close", (code2) => {
|
|
298130
298360
|
clearTimeout(timeout);
|
|
298131
|
-
if (
|
|
298361
|
+
if (code2 === 0) {
|
|
298132
298362
|
try {
|
|
298133
298363
|
const responseJson = JSON.parse(output);
|
|
298134
298364
|
const response = new executable_response_1.ExecutableResponse(responseJson);
|
|
@@ -298140,7 +298370,7 @@ var require_pluggable_auth_handler = __commonJS((exports) => {
|
|
|
298140
298370
|
return reject2(new executable_response_1.ExecutableResponseError(`The executable returned an invalid response: ${output}`));
|
|
298141
298371
|
}
|
|
298142
298372
|
} else {
|
|
298143
|
-
return reject2(new pluggable_auth_client_1.ExecutableError(output,
|
|
298373
|
+
return reject2(new pluggable_auth_client_1.ExecutableError(output, code2.toString()));
|
|
298144
298374
|
}
|
|
298145
298375
|
});
|
|
298146
298376
|
});
|
|
@@ -298203,9 +298433,9 @@ var require_pluggable_auth_client = __commonJS((exports) => {
|
|
|
298203
298433
|
var pluggable_auth_handler_1 = require_pluggable_auth_handler();
|
|
298204
298434
|
|
|
298205
298435
|
class ExecutableError extends Error {
|
|
298206
|
-
constructor(message,
|
|
298207
|
-
super(`The executable failed with exit code: ${
|
|
298208
|
-
this.code =
|
|
298436
|
+
constructor(message, code2) {
|
|
298437
|
+
super(`The executable failed with exit code: ${code2} and error message: ${message}.`);
|
|
298438
|
+
this.code = code2;
|
|
298209
298439
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
298210
298440
|
}
|
|
298211
298441
|
}
|
|
@@ -302068,8 +302298,8 @@ var require_commonjs = __commonJS((exports) => {
|
|
|
302068
302298
|
return String.prototype.replace.call(text, encodeRegExp, function(input) {
|
|
302069
302299
|
var result = references[input];
|
|
302070
302300
|
if (!result) {
|
|
302071
|
-
var
|
|
302072
|
-
result = (isHex ? "&#x" +
|
|
302301
|
+
var code2 = input.length > 1 ? (0, surrogate_pairs_js_1.getCodePoint)(input, 0) : input.charCodeAt(0);
|
|
302302
|
+
result = (isHex ? "&#x" + code2.toString(16) : "&#" + code2) + ";";
|
|
302073
302303
|
}
|
|
302074
302304
|
return result;
|
|
302075
302305
|
});
|
|
@@ -333380,10 +333610,10 @@ function summarizeReportDiscovery(files, findings) {
|
|
|
333380
333610
|
summary.reports[layout] += 1;
|
|
333381
333611
|
}
|
|
333382
333612
|
for (const {
|
|
333383
|
-
code = UNCODED_REPORT_FINDING,
|
|
333613
|
+
code: code2 = UNCODED_REPORT_FINDING,
|
|
333384
333614
|
severity = "warn"
|
|
333385
333615
|
} of findings) {
|
|
333386
|
-
const bySeverity = summary.findings[
|
|
333616
|
+
const bySeverity = summary.findings[code2] ??= {};
|
|
333387
333617
|
bySeverity[severity] = (bySeverity[severity] ?? 0) + 1;
|
|
333388
333618
|
}
|
|
333389
333619
|
return summary;
|
|
@@ -333400,9 +333630,9 @@ function recordReportDiscovery(summary) {
|
|
|
333400
333630
|
if (count4 > 0)
|
|
333401
333631
|
reportFiles().add(count4, { status });
|
|
333402
333632
|
}
|
|
333403
|
-
for (const [
|
|
333633
|
+
for (const [code2, bySeverity] of Object.entries(summary.findings)) {
|
|
333404
333634
|
for (const [severity, count4] of Object.entries(bySeverity)) {
|
|
333405
|
-
lintFindings().add(count4, { code, severity });
|
|
333635
|
+
lintFindings().add(count4, { code: code2, severity });
|
|
333406
333636
|
}
|
|
333407
333637
|
}
|
|
333408
333638
|
}
|
|
@@ -333470,8 +333700,8 @@ function opensLine(tokens, k) {
|
|
|
333470
333700
|
const from = tokens.end[k - 1];
|
|
333471
333701
|
const to = tokens.start[k];
|
|
333472
333702
|
for (let at = from;at < to; at++) {
|
|
333473
|
-
const
|
|
333474
|
-
if (
|
|
333703
|
+
const code2 = tokens.source.charCodeAt(at);
|
|
333704
|
+
if (code2 === 10 || code2 === 13)
|
|
333475
333705
|
return true;
|
|
333476
333706
|
}
|
|
333477
333707
|
return false;
|
|
@@ -333548,9 +333778,9 @@ function stripMalloyCommentsAndLiterals(text) {
|
|
|
333548
333778
|
};
|
|
333549
333779
|
let i2 = 0;
|
|
333550
333780
|
while (i2 < text.length) {
|
|
333551
|
-
const
|
|
333552
|
-
if (text.startsWith("--", i2) || text.startsWith("//", i2) ||
|
|
333553
|
-
const end =
|
|
333781
|
+
const code2 = text.charCodeAt(i2);
|
|
333782
|
+
if (text.startsWith("--", i2) || text.startsWith("//", i2) || code2 === 35) {
|
|
333783
|
+
const end = code2 === 35 ? skipAnnotation(text, i2, trivia) : lineTrivia(text, i2, trivia);
|
|
333554
333784
|
if (end >= 0) {
|
|
333555
333785
|
i2 = end;
|
|
333556
333786
|
continue;
|
|
@@ -333562,19 +333792,19 @@ function stripMalloyCommentsAndLiterals(text) {
|
|
|
333562
333792
|
i2 = end;
|
|
333563
333793
|
continue;
|
|
333564
333794
|
}
|
|
333565
|
-
if (prefixAt >= 0 && !isLexerSpace(
|
|
333566
|
-
if ((
|
|
333795
|
+
if (prefixAt >= 0 && !isLexerSpace(code2)) {
|
|
333796
|
+
if ((code2 === 39 || code2 === 34 || code2 === 96) && blankedSince >= 0) {
|
|
333567
333797
|
marks.push(blankedSince);
|
|
333568
333798
|
}
|
|
333569
333799
|
prefixAt = -1;
|
|
333570
333800
|
blankedSince = -1;
|
|
333571
333801
|
}
|
|
333572
|
-
if (
|
|
333802
|
+
if (code2 === 123) {
|
|
333573
333803
|
depth++;
|
|
333574
333804
|
i2++;
|
|
333575
333805
|
continue;
|
|
333576
333806
|
}
|
|
333577
|
-
if (
|
|
333807
|
+
if (code2 === 125) {
|
|
333578
333808
|
depth--;
|
|
333579
333809
|
i2++;
|
|
333580
333810
|
if (sqlResume.length > 0 && sqlResume[sqlResume.length - 1] === depth) {
|
|
@@ -333587,13 +333817,13 @@ function stripMalloyCommentsAndLiterals(text) {
|
|
|
333587
333817
|
i2 = sql(i2 + 3);
|
|
333588
333818
|
continue;
|
|
333589
333819
|
}
|
|
333590
|
-
if (
|
|
333820
|
+
if (code2 === 39 || code2 === 34 || code2 === 96) {
|
|
333591
333821
|
const close = scan.stringClose(i2);
|
|
333592
333822
|
if (close < 0) {
|
|
333593
333823
|
i2++;
|
|
333594
333824
|
continue;
|
|
333595
333825
|
}
|
|
333596
|
-
if (
|
|
333826
|
+
if (code2 !== 96)
|
|
333597
333827
|
blank(i2 + 1, close);
|
|
333598
333828
|
i2 = close + 1;
|
|
333599
333829
|
continue;
|
|
@@ -333610,7 +333840,7 @@ function stripMalloyCommentsAndLiterals(text) {
|
|
|
333610
333840
|
i2 = end;
|
|
333611
333841
|
continue;
|
|
333612
333842
|
}
|
|
333613
|
-
const letter =
|
|
333843
|
+
const letter = code2 | 32;
|
|
333614
333844
|
if ((letter === 102 || letter === 115) && !continuesToken(text, i2)) {
|
|
333615
333845
|
prefixAt = i2;
|
|
333616
333846
|
}
|
|
@@ -333631,8 +333861,8 @@ function lineTrivia(text, i2, blank) {
|
|
|
333631
333861
|
function lineEnd(text, i2) {
|
|
333632
333862
|
let at = i2;
|
|
333633
333863
|
while (at < text.length) {
|
|
333634
|
-
const
|
|
333635
|
-
if (
|
|
333864
|
+
const code2 = text.charCodeAt(at);
|
|
333865
|
+
if (code2 === 10 || code2 === 13)
|
|
333636
333866
|
return at;
|
|
333637
333867
|
at++;
|
|
333638
333868
|
}
|
|
@@ -333681,8 +333911,8 @@ function skipAnnotation(text, i2, blank) {
|
|
|
333681
333911
|
}
|
|
333682
333912
|
function closesBlock(text, at, column, closer) {
|
|
333683
333913
|
for (let c = 0;c < column; c++) {
|
|
333684
|
-
const
|
|
333685
|
-
if (
|
|
333914
|
+
const code2 = text.charCodeAt(at + c);
|
|
333915
|
+
if (code2 !== 32 && code2 !== 9)
|
|
333686
333916
|
return false;
|
|
333687
333917
|
}
|
|
333688
333918
|
const from = at + column;
|
|
@@ -333708,28 +333938,28 @@ function sqlStop(text, from) {
|
|
|
333708
333938
|
if (!reach[j & 3])
|
|
333709
333939
|
continue;
|
|
333710
333940
|
reach[j & 3] = false;
|
|
333711
|
-
const
|
|
333941
|
+
const code2 = text.charCodeAt(j);
|
|
333712
333942
|
const next = text.charCodeAt(j + 1);
|
|
333713
|
-
if (
|
|
333943
|
+
if (code2 === 34 && next === 34 && text.charCodeAt(j + 2) === 34) {
|
|
333714
333944
|
if (!found || j + 3 > stop.end) {
|
|
333715
333945
|
stop = { bodyEnd: j, end: j + 3, opensCode: false };
|
|
333716
333946
|
}
|
|
333717
333947
|
found = true;
|
|
333718
333948
|
continue;
|
|
333719
333949
|
}
|
|
333720
|
-
if (
|
|
333950
|
+
if (code2 === 37 && next === 123) {
|
|
333721
333951
|
if (!found || j + 2 > stop.end) {
|
|
333722
333952
|
stop = { bodyEnd: j, end: j + 2, opensCode: true };
|
|
333723
333953
|
}
|
|
333724
333954
|
found = true;
|
|
333725
333955
|
continue;
|
|
333726
333956
|
}
|
|
333727
|
-
if (
|
|
333957
|
+
if (code2 === 92) {
|
|
333728
333958
|
mark(j + 1);
|
|
333729
333959
|
mark(j + 2);
|
|
333730
|
-
} else if (
|
|
333960
|
+
} else if (code2 === 34) {
|
|
333731
333961
|
mark(next === 34 ? j + 3 : j + 2);
|
|
333732
|
-
} else if (
|
|
333962
|
+
} else if (code2 === 37) {
|
|
333733
333963
|
mark(j + 2);
|
|
333734
333964
|
} else {
|
|
333735
333965
|
mark(j + 1);
|
|
@@ -333737,8 +333967,8 @@ function sqlStop(text, from) {
|
|
|
333737
333967
|
}
|
|
333738
333968
|
return stop;
|
|
333739
333969
|
}
|
|
333740
|
-
function isLexerSpace(
|
|
333741
|
-
return
|
|
333970
|
+
function isLexerSpace(code2) {
|
|
333971
|
+
return code2 === 32 || code2 === 9 || code2 === 10 || code2 === 11 || code2 === 13 || code2 === 160;
|
|
333742
333972
|
}
|
|
333743
333973
|
|
|
333744
333974
|
class StringScan {
|
|
@@ -333756,16 +333986,16 @@ class StringScan {
|
|
|
333756
333986
|
return -1;
|
|
333757
333987
|
let j = i2 + 1;
|
|
333758
333988
|
while (j < text.length) {
|
|
333759
|
-
const
|
|
333760
|
-
if (
|
|
333989
|
+
const code2 = text.charCodeAt(j);
|
|
333990
|
+
if (code2 === quote)
|
|
333761
333991
|
return j;
|
|
333762
|
-
if (
|
|
333992
|
+
if (code2 === 92) {
|
|
333763
333993
|
if (j + 1 >= text.length || text.charCodeAt(j + 1) === 10)
|
|
333764
333994
|
break;
|
|
333765
333995
|
j += 2;
|
|
333766
333996
|
continue;
|
|
333767
333997
|
}
|
|
333768
|
-
if (
|
|
333998
|
+
if (code2 < 32 && code2 !== 9)
|
|
333769
333999
|
break;
|
|
333770
334000
|
j++;
|
|
333771
334001
|
}
|
|
@@ -333774,13 +334004,13 @@ class StringScan {
|
|
|
333774
334004
|
}
|
|
333775
334005
|
prefixedLiteral(i2) {
|
|
333776
334006
|
const text = this.text;
|
|
333777
|
-
const
|
|
333778
|
-
if (
|
|
334007
|
+
const code2 = text.charCodeAt(i2);
|
|
334008
|
+
if (code2 === 47) {
|
|
333779
334009
|
if (text.charCodeAt(i2 + 1) !== 39)
|
|
333780
334010
|
return;
|
|
333781
334011
|
return this.raw(i2 + 1, 39, false);
|
|
333782
334012
|
}
|
|
333783
|
-
const letter =
|
|
334013
|
+
const letter = code2 | 32;
|
|
333784
334014
|
if (letter !== 102 && letter !== 114 && letter !== 115)
|
|
333785
334015
|
return;
|
|
333786
334016
|
if (continuesToken(text, i2))
|
|
@@ -333809,18 +334039,18 @@ class StringScan {
|
|
|
333809
334039
|
const text = this.text;
|
|
333810
334040
|
let j = open + 1;
|
|
333811
334041
|
while (j < text.length) {
|
|
333812
|
-
const
|
|
333813
|
-
if (
|
|
334042
|
+
const code2 = text.charCodeAt(j);
|
|
334043
|
+
if (code2 === 10) {
|
|
333814
334044
|
return endsAtNewline ? { open, quote: 1, bodyEnd: j, end: j + 1 } : undefined;
|
|
333815
334045
|
}
|
|
333816
|
-
if (
|
|
334046
|
+
if (code2 === 92) {
|
|
333817
334047
|
if (j + 1 >= text.length || text.charCodeAt(j + 1) === 10) {
|
|
333818
334048
|
return;
|
|
333819
334049
|
}
|
|
333820
334050
|
j += 2;
|
|
333821
334051
|
continue;
|
|
333822
334052
|
}
|
|
333823
|
-
if (
|
|
334053
|
+
if (code2 === quote)
|
|
333824
334054
|
return { open, quote: 1, bodyEnd: j, end: j + 1 };
|
|
333825
334055
|
j++;
|
|
333826
334056
|
}
|
|
@@ -333833,12 +334063,12 @@ class StringScan {
|
|
|
333833
334063
|
return -1;
|
|
333834
334064
|
let j = body;
|
|
333835
334065
|
while (j < text.length) {
|
|
333836
|
-
const
|
|
333837
|
-
if (
|
|
334066
|
+
const code2 = text.charCodeAt(j);
|
|
334067
|
+
if (code2 === 92) {
|
|
333838
334068
|
j += 2;
|
|
333839
334069
|
continue;
|
|
333840
334070
|
}
|
|
333841
|
-
if (
|
|
334071
|
+
if (code2 === quote && text.charCodeAt(j + 1) === quote && text.charCodeAt(j + 2) === quote) {
|
|
333842
334072
|
return j;
|
|
333843
334073
|
}
|
|
333844
334074
|
j++;
|
|
@@ -333856,8 +334086,8 @@ function continuesToken(text, i2) {
|
|
|
333856
334086
|
let at = i2 - 1;
|
|
333857
334087
|
if ((text.charCodeAt(at) & 64512) === 56320 && at > 0)
|
|
333858
334088
|
at--;
|
|
333859
|
-
const
|
|
333860
|
-
return
|
|
334089
|
+
const code2 = text.charCodeAt(at);
|
|
334090
|
+
return code2 === 36 || isNameCode(code2, text, at);
|
|
333861
334091
|
}
|
|
333862
334092
|
function buildDerivationBaseMap(query2) {
|
|
333863
334093
|
const out = new Map;
|
|
@@ -333880,15 +334110,15 @@ function readDefinitions(query2, onItem) {
|
|
|
333880
334110
|
readStatementItems(tokens, i2 + 2, false, (name, base) => onItem(keyword, name, base));
|
|
333881
334111
|
}
|
|
333882
334112
|
}
|
|
333883
|
-
function isNameCode(
|
|
333884
|
-
if (
|
|
333885
|
-
return
|
|
334113
|
+
function isNameCode(code2, text, at) {
|
|
334114
|
+
if (code2 < 128) {
|
|
334115
|
+
return code2 >= 48 && code2 <= 57 || code2 >= 65 && code2 <= 90 || code2 >= 97 && code2 <= 122 || code2 === 95;
|
|
333886
334116
|
}
|
|
333887
334117
|
return NAME_CHAR.test(String.fromCodePoint(text.codePointAt(at)));
|
|
333888
334118
|
}
|
|
333889
|
-
function isSpaceCode(
|
|
333890
|
-
if (
|
|
333891
|
-
return
|
|
334119
|
+
function isSpaceCode(code2, text, at) {
|
|
334120
|
+
if (code2 < 128)
|
|
334121
|
+
return code2 === 32 || code2 >= 9 && code2 <= 13;
|
|
333892
334122
|
return SPACE_CHAR.test(String.fromCodePoint(text.codePointAt(at)));
|
|
333893
334123
|
}
|
|
333894
334124
|
function unitsAt(text, at) {
|
|
@@ -333916,12 +334146,12 @@ function tokenize(text) {
|
|
|
333916
334146
|
const scan = new StringScan(text);
|
|
333917
334147
|
let i2 = 0;
|
|
333918
334148
|
while (i2 < text.length) {
|
|
333919
|
-
const
|
|
333920
|
-
if (isSpaceCode(
|
|
334149
|
+
const code2 = text.charCodeAt(i2);
|
|
334150
|
+
if (isSpaceCode(code2, text, i2)) {
|
|
333921
334151
|
i2 += unitsAt(text, i2);
|
|
333922
334152
|
continue;
|
|
333923
334153
|
}
|
|
333924
|
-
const close =
|
|
334154
|
+
const close = code2 === 96 ? scan.stringClose(i2) : -1;
|
|
333925
334155
|
if (close >= 0) {
|
|
333926
334156
|
const index2 = push2(QUOTED, i2 + 1, close);
|
|
333927
334157
|
const inner = text.slice(i2 + 1, close);
|
|
@@ -333931,7 +334161,7 @@ function tokenize(text) {
|
|
|
333931
334161
|
i2 = close + 1;
|
|
333932
334162
|
continue;
|
|
333933
334163
|
}
|
|
333934
|
-
if (isNameCode(
|
|
334164
|
+
if (isNameCode(code2, text, i2)) {
|
|
333935
334165
|
let j = i2 + unitsAt(text, i2);
|
|
333936
334166
|
while (j < text.length && isNameCode(text.charCodeAt(j), text, j)) {
|
|
333937
334167
|
j += unitsAt(text, j);
|
|
@@ -333942,9 +334172,9 @@ function tokenize(text) {
|
|
|
333942
334172
|
}
|
|
333943
334173
|
const units = unitsAt(text, i2);
|
|
333944
334174
|
const index = push2(PUNCT, i2, i2 + units);
|
|
333945
|
-
if (
|
|
334175
|
+
if (code2 === 40 || code2 === 91 || code2 === 123) {
|
|
333946
334176
|
open.push(index);
|
|
333947
|
-
} else if (
|
|
334177
|
+
} else if (code2 === 41 || code2 === 93 || code2 === 125) {
|
|
333948
334178
|
const at = open.pop();
|
|
333949
334179
|
if (at !== undefined) {
|
|
333950
334180
|
tokens.partner[at] = index;
|
|
@@ -333973,8 +334203,8 @@ function isWord(tokens, i2, word) {
|
|
|
333973
334203
|
}
|
|
333974
334204
|
const from = tokens.start[i2];
|
|
333975
334205
|
for (let k = 0;k < word.length; k++) {
|
|
333976
|
-
const
|
|
333977
|
-
const lower2 =
|
|
334206
|
+
const code2 = tokens.source.charCodeAt(from + k);
|
|
334207
|
+
const lower2 = code2 >= 65 && code2 <= 90 ? code2 + 32 : code2;
|
|
333978
334208
|
if (lower2 !== word.charCodeAt(k))
|
|
333979
334209
|
return false;
|
|
333980
334210
|
}
|
|
@@ -347669,14 +347899,14 @@ var require_luxon = __commonJS((exports) => {
|
|
|
347669
347899
|
if (isNaN(value)) {
|
|
347670
347900
|
value = "";
|
|
347671
347901
|
for (let i2 = 0;i2 < str.length; i2++) {
|
|
347672
|
-
const
|
|
347902
|
+
const code2 = str.charCodeAt(i2);
|
|
347673
347903
|
if (str[i2].search(numberingSystems.hanidec) !== -1) {
|
|
347674
347904
|
value += hanidecChars.indexOf(str[i2]);
|
|
347675
347905
|
} else {
|
|
347676
347906
|
for (const key in numberingSystemsUTF16) {
|
|
347677
347907
|
const [min, max] = numberingSystemsUTF16[key];
|
|
347678
|
-
if (
|
|
347679
|
-
value +=
|
|
347908
|
+
if (code2 >= min && code2 <= max) {
|
|
347909
|
+
value += code2 - min;
|
|
347680
347910
|
}
|
|
347681
347911
|
}
|
|
347682
347912
|
}
|
|
@@ -354119,9 +354349,9 @@ function collectDynamicTerms(filterList) {
|
|
|
354119
354349
|
continue;
|
|
354120
354350
|
if (!readsAGiven(entry, new WeakSet))
|
|
354121
354351
|
continue;
|
|
354122
|
-
const
|
|
354352
|
+
const code2 = entry.code;
|
|
354123
354353
|
terms2.push({
|
|
354124
|
-
code: typeof
|
|
354354
|
+
code: typeof code2 === "string" ? code2 : "",
|
|
354125
354355
|
givens: givenNames(entry),
|
|
354126
354356
|
columns: localFieldNames(entry)
|
|
354127
354357
|
});
|
|
@@ -356443,10 +356673,10 @@ function narrowSchemaToPublic(schema, fields) {
|
|
|
356443
356673
|
function extractSourceFilters(filterList) {
|
|
356444
356674
|
const out = [];
|
|
356445
356675
|
for (const entry of filterList ?? []) {
|
|
356446
|
-
const
|
|
356676
|
+
const code2 = entry?.code;
|
|
356447
356677
|
out.push({
|
|
356448
356678
|
kind: "filter",
|
|
356449
|
-
code: typeof
|
|
356679
|
+
code: typeof code2 === "string" ? code2 : UNREPRODUCIBLE_FILTER
|
|
356450
356680
|
});
|
|
356451
356681
|
}
|
|
356452
356682
|
return out;
|
|
@@ -358953,8 +359183,8 @@ var init_esm2 = __esm(() => {
|
|
|
358953
359183
|
return this;
|
|
358954
359184
|
}
|
|
358955
359185
|
_handleError(error) {
|
|
358956
|
-
const
|
|
358957
|
-
if (error &&
|
|
359186
|
+
const code2 = error && error.code;
|
|
359187
|
+
if (error && code2 !== "ENOENT" && code2 !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code2 !== "EPERM" && code2 !== "EACCES")) {
|
|
358958
359188
|
this.emit(EVENTS.ERROR, error);
|
|
358959
359189
|
}
|
|
358960
359190
|
return error || this.closed;
|
|
@@ -364343,13 +364573,13 @@ class PackageLoadPool {
|
|
|
364343
364573
|
pw.retiring = true;
|
|
364344
364574
|
readyReject(err);
|
|
364345
364575
|
});
|
|
364346
|
-
worker.on("exit", (
|
|
364576
|
+
worker.on("exit", (code2) => {
|
|
364347
364577
|
pw.exited = true;
|
|
364348
364578
|
clearTimeout(spawnTimer);
|
|
364349
|
-
readyReject(new Error(`Package-load worker #${id} exited before becoming ready (code=${
|
|
364350
|
-
logger.warn(`PackageLoadPool: worker #${id} exited (code=${
|
|
364579
|
+
readyReject(new Error(`Package-load worker #${id} exited before becoming ready (code=${code2})`));
|
|
364580
|
+
logger.warn(`PackageLoadPool: worker #${id} exited (code=${code2}, inFlight=${pw.inFlight.size})`);
|
|
364351
364581
|
for (const jobId of Array.from(pw.inFlight)) {
|
|
364352
|
-
this.failJob(jobId, new Error(`Package-load worker #${id} exited unexpectedly (code=${
|
|
364582
|
+
this.failJob(jobId, new Error(`Package-load worker #${id} exited unexpectedly (code=${code2})`));
|
|
364353
364583
|
}
|
|
364354
364584
|
pw.inFlight.clear();
|
|
364355
364585
|
const idx = this.workers.indexOf(pw);
|
|
@@ -366789,7 +367019,7 @@ function getEntityFromMalloyField(field, source, docString, connection, tablePat
|
|
|
366789
367019
|
const name = nameOverride ?? field.name;
|
|
366790
367020
|
const field_type = inferType(field, docString);
|
|
366791
367021
|
const field_data_type = inferFieldDataType(field);
|
|
366792
|
-
const
|
|
367022
|
+
const code2 = extractCodeFromEntity(field, docString);
|
|
366793
367023
|
const tags = getTags(field);
|
|
366794
367024
|
const description = getDescriptionFromTags(tags);
|
|
366795
367025
|
let catalog_name = null;
|
|
@@ -366821,7 +367051,7 @@ function getEntityFromMalloyField(field, source, docString, connection, tablePat
|
|
|
366821
367051
|
source,
|
|
366822
367052
|
field_type,
|
|
366823
367053
|
field_data_type,
|
|
366824
|
-
code,
|
|
367054
|
+
code: code2,
|
|
366825
367055
|
tags,
|
|
366826
367056
|
description,
|
|
366827
367057
|
table_info,
|
|
@@ -366900,8 +367130,8 @@ function fieldType(field) {
|
|
|
366900
367130
|
return field.isAtomicField() ? field.type.toString() : "query";
|
|
366901
367131
|
}
|
|
366902
367132
|
function isMalloyDefined(field, docString) {
|
|
366903
|
-
const
|
|
366904
|
-
const lines =
|
|
367133
|
+
const code2 = extractCodeFromEntity(field, docString);
|
|
367134
|
+
const lines = code2.split(`
|
|
366905
367135
|
`);
|
|
366906
367136
|
const keep = [];
|
|
366907
367137
|
for (const line of lines) {
|
|
@@ -369703,11 +369933,11 @@ function correctFields(fields) {
|
|
|
369703
369933
|
const meta = field.resultMetadata;
|
|
369704
369934
|
if (meta?.fieldKind !== "dimension")
|
|
369705
369935
|
continue;
|
|
369706
|
-
const
|
|
369707
|
-
if (
|
|
369936
|
+
const code2 = drillCode(field, meta);
|
|
369937
|
+
if (code2 === null)
|
|
369708
369938
|
delete meta.fieldKind;
|
|
369709
|
-
else if (
|
|
369710
|
-
meta.sourceExpression =
|
|
369939
|
+
else if (code2 !== undefined)
|
|
369940
|
+
meta.sourceExpression = code2;
|
|
369711
369941
|
}
|
|
369712
369942
|
}
|
|
369713
369943
|
function drillCode(field, meta) {
|
|
@@ -369843,7 +370073,7 @@ function mapRunError(err, ctx) {
|
|
|
369843
370073
|
throw new BadRequestError(`${ctx.failurePrefix}: ${errorMessage}`);
|
|
369844
370074
|
}
|
|
369845
370075
|
function isGivenBindingFailure(err) {
|
|
369846
|
-
const isGivenCode = (
|
|
370076
|
+
const isGivenCode = (code2) => typeof code2 === "string" && (code2.startsWith("runtime-given-") || code2.startsWith("compiler-given-"));
|
|
369847
370077
|
if (isGivenCode(err?.code))
|
|
369848
370078
|
return true;
|
|
369849
370079
|
const problems = err?.problems;
|
|
@@ -370616,8 +370846,8 @@ function isGroupableDimension(f5) {
|
|
|
370616
370846
|
return f5.expressionType === "scalar";
|
|
370617
370847
|
}
|
|
370618
370848
|
function validateGrainDimension(sourceName, measure, source, grainDimension) {
|
|
370619
|
-
const violation = (
|
|
370620
|
-
code,
|
|
370849
|
+
const violation = (code2, message) => ({
|
|
370850
|
+
code: code2,
|
|
370621
370851
|
sourceName,
|
|
370622
370852
|
fieldName: measure,
|
|
370623
370853
|
message
|
|
@@ -371437,7 +371667,7 @@ async function getNotebookModelMaterializer(runtime, importBaseURL, modelURL, mo
|
|
|
371437
371667
|
} else {
|
|
371438
371668
|
return;
|
|
371439
371669
|
}
|
|
371440
|
-
}))).filter((
|
|
371670
|
+
}))).filter((cell2) => cell2 !== undefined);
|
|
371441
371671
|
return {
|
|
371442
371672
|
modelMaterializer: mm,
|
|
371443
371673
|
runnableNotebookCells
|
|
@@ -371508,10 +371738,10 @@ var init_model_runtime = __esm(() => {
|
|
|
371508
371738
|
|
|
371509
371739
|
// src/service/model_notebook_cell.ts
|
|
371510
371740
|
function declaredGivensPerCell(cells) {
|
|
371511
|
-
return cells.map((
|
|
371512
|
-
if (!
|
|
371741
|
+
return cells.map((cell2) => {
|
|
371742
|
+
if (!cell2.modelDef)
|
|
371513
371743
|
return;
|
|
371514
|
-
const registry =
|
|
371744
|
+
const registry = cell2.modelDef.givens ?? {};
|
|
371515
371745
|
return {
|
|
371516
371746
|
ids: new Set(Object.keys(registry)),
|
|
371517
371747
|
names: new Set(Object.values(registry).map((g2) => g2.name))
|
|
@@ -372275,12 +372505,12 @@ var init_model = __esm(() => {
|
|
|
372275
372505
|
return;
|
|
372276
372506
|
}
|
|
372277
372507
|
selfGraftScopeForCell(cellIndex) {
|
|
372278
|
-
const
|
|
372279
|
-
if (!
|
|
372508
|
+
const cell2 = this.runnableNotebookCells?.[cellIndex];
|
|
372509
|
+
if (!cell2?.modelDef || !cell2.modelMaterializer)
|
|
372280
372510
|
return;
|
|
372281
372511
|
return {
|
|
372282
|
-
modelDef:
|
|
372283
|
-
materializer:
|
|
372512
|
+
modelDef: cell2.modelDef,
|
|
372513
|
+
materializer: cell2.modelMaterializer,
|
|
372284
372514
|
cacheScope: `cell-self:${cellIndex}`
|
|
372285
372515
|
};
|
|
372286
372516
|
}
|
|
@@ -373270,8 +373500,8 @@ ${query2}`;
|
|
|
373270
373500
|
if (prepared._query?.structRef !== graftedStruct) {
|
|
373271
373501
|
throw new Error("the grafted run target is not the one the query will execute");
|
|
373272
373502
|
}
|
|
373273
|
-
for (const
|
|
373274
|
-
if (!graftedStruct.filterList?.some((f5) => f5.code ===
|
|
373503
|
+
for (const code2 of expectedCodes) {
|
|
373504
|
+
if (!graftedStruct.filterList?.some((f5) => f5.code === code2)) {
|
|
373275
373505
|
throw new Error("a row-level gate condition did not land on the recompiled query");
|
|
373276
373506
|
}
|
|
373277
373507
|
}
|
|
@@ -373279,20 +373509,20 @@ ${query2}`;
|
|
|
373279
373509
|
};
|
|
373280
373510
|
}
|
|
373281
373511
|
static MAX_GATE_PROOF_DEPTH = 8;
|
|
373282
|
-
filterListContainsCode(struct, modelDef,
|
|
373283
|
-
return this.resolveFilterListLandingStruct(struct, modelDef,
|
|
373512
|
+
filterListContainsCode(struct, modelDef, code2, depth) {
|
|
373513
|
+
return this.resolveFilterListLandingStruct(struct, modelDef, code2, depth) !== undefined;
|
|
373284
373514
|
}
|
|
373285
|
-
resolveFilterListLandingStruct(struct, modelDef,
|
|
373515
|
+
resolveFilterListLandingStruct(struct, modelDef, code2, depth) {
|
|
373286
373516
|
if (!struct || depth > Model.MAX_GATE_PROOF_DEPTH)
|
|
373287
373517
|
return;
|
|
373288
|
-
if (struct.filterList?.some((f5) => f5.code ===
|
|
373518
|
+
if (struct.filterList?.some((f5) => f5.code === code2))
|
|
373289
373519
|
return struct;
|
|
373290
373520
|
const duck = struct;
|
|
373291
373521
|
if (duck.type === "query_source" && modelDef) {
|
|
373292
373522
|
const ref = duck.query?.compositeResolvedSourceDef ?? duck.query?.structRef;
|
|
373293
373523
|
const base = typeof ref === "string" ? modelDef.contents[ref] : ref;
|
|
373294
373524
|
if (base && isSourceDef9(base)) {
|
|
373295
|
-
return this.resolveFilterListLandingStruct(base, modelDef,
|
|
373525
|
+
return this.resolveFilterListLandingStruct(base, modelDef, code2, depth + 1);
|
|
373296
373526
|
}
|
|
373297
373527
|
}
|
|
373298
373528
|
return;
|
|
@@ -373613,18 +373843,18 @@ ${query2}`;
|
|
|
373613
373843
|
}
|
|
373614
373844
|
async preparedCellQueries() {
|
|
373615
373845
|
const out = [];
|
|
373616
|
-
for (const
|
|
373617
|
-
if (!
|
|
373846
|
+
for (const cell2 of this.runnableNotebookCells ?? []) {
|
|
373847
|
+
if (!cell2.runnable)
|
|
373618
373848
|
continue;
|
|
373619
373849
|
let prepared;
|
|
373620
373850
|
try {
|
|
373621
|
-
prepared = await
|
|
373851
|
+
prepared = await cell2.runnable.getPreparedQuery();
|
|
373622
373852
|
} catch {
|
|
373623
373853
|
continue;
|
|
373624
373854
|
}
|
|
373625
373855
|
out.push({
|
|
373626
373856
|
query: prepared._query,
|
|
373627
|
-
modelDef: prepared._modelDef ??
|
|
373857
|
+
modelDef: prepared._modelDef ?? cell2.modelDef
|
|
373628
373858
|
});
|
|
373629
373859
|
}
|
|
373630
373860
|
return out;
|
|
@@ -374099,14 +374329,14 @@ ${query2}`;
|
|
|
374099
374329
|
this.notebookAnnotations = read.annotations;
|
|
374100
374330
|
const layout = this.readNotebookLayout();
|
|
374101
374331
|
this.notebookLayout = layout;
|
|
374102
|
-
const cells = read.cells.filter((
|
|
374332
|
+
const cells = read.cells.filter((cell2) => cell2.kind === "definition").map((cell2) => ({
|
|
374103
374333
|
type: "code",
|
|
374104
374334
|
kind: "definition",
|
|
374105
|
-
text:
|
|
374106
|
-
markdown:
|
|
374107
|
-
proseLines:
|
|
374108
|
-
codeLine:
|
|
374109
|
-
caption:
|
|
374335
|
+
text: cell2.text,
|
|
374336
|
+
markdown: cell2.markdown,
|
|
374337
|
+
proseLines: cell2.proseLines,
|
|
374338
|
+
codeLine: cell2.codeLine,
|
|
374339
|
+
caption: cell2.caption,
|
|
374110
374340
|
modelDef
|
|
374111
374341
|
}));
|
|
374112
374342
|
if (layout) {
|
|
@@ -374151,10 +374381,10 @@ ${query2}`;
|
|
|
374151
374381
|
}) : undefined;
|
|
374152
374382
|
}
|
|
374153
374383
|
firstMarkdownHeading() {
|
|
374154
|
-
for (const
|
|
374155
|
-
if (
|
|
374384
|
+
for (const cell2 of this.runnableNotebookCells ?? []) {
|
|
374385
|
+
if (cell2.type !== "markdown")
|
|
374156
374386
|
continue;
|
|
374157
|
-
for (const line of
|
|
374387
|
+
for (const line of cell2.text.split(`
|
|
374158
374388
|
`)) {
|
|
374159
374389
|
const trimmed = line.trim();
|
|
374160
374390
|
if (trimmed.length === 0)
|
|
@@ -374738,11 +374968,11 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374738
374968
|
`);
|
|
374739
374969
|
return (name) => this.isCuratedSource(name) || this.derivesFromCurated(name, undefined, context);
|
|
374740
374970
|
}
|
|
374741
|
-
async showsCellQueryInfo(cellIndex,
|
|
374742
|
-
if (!
|
|
374971
|
+
async showsCellQueryInfo(cellIndex, cell2) {
|
|
374972
|
+
if (!cell2.runnable)
|
|
374743
374973
|
return this.notebookReadable(cellIndex) === undefined;
|
|
374744
374974
|
try {
|
|
374745
|
-
await this.assertNotebookCellOnSurface(cellIndex,
|
|
374975
|
+
await this.assertNotebookCellOnSurface(cellIndex, cell2.runnable);
|
|
374746
374976
|
return true;
|
|
374747
374977
|
} catch (error) {
|
|
374748
374978
|
if (error instanceof NotQueryableError)
|
|
@@ -374753,13 +374983,13 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374753
374983
|
shownRunIndexes(cells, shownCells) {
|
|
374754
374984
|
const shown = new Set;
|
|
374755
374985
|
if (this.notebookFormat() === "malloy") {
|
|
374756
|
-
cells.forEach((
|
|
374757
|
-
if (
|
|
374758
|
-
shown.add(
|
|
374986
|
+
cells.forEach((cell2, index) => {
|
|
374987
|
+
if (cell2.queryIndex !== undefined && shownCells.has(index))
|
|
374988
|
+
shown.add(cell2.queryIndex);
|
|
374759
374989
|
});
|
|
374760
374990
|
return shown;
|
|
374761
374991
|
}
|
|
374762
|
-
const last = cells.findLastIndex((
|
|
374992
|
+
const last = cells.findLastIndex((cell2) => cell2.type === "code" && cell2.modelDef !== undefined);
|
|
374763
374993
|
const runs = cells[last]?.modelDef?.queryList.length ?? 0;
|
|
374764
374994
|
if (last >= 0 && shownCells.has(last) && runs > 0 && runs === (this.modelInfo?.anonymous_queries?.length ?? 0)) {
|
|
374765
374995
|
shown.add(runs - 1);
|
|
@@ -374770,20 +375000,20 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374770
375000
|
const cells = this.runnableNotebookCells ?? [];
|
|
374771
375001
|
const notebookCells = [];
|
|
374772
375002
|
const shownCells = new Set;
|
|
374773
|
-
for (const [index,
|
|
374774
|
-
const shown = (
|
|
375003
|
+
for (const [index, cell2] of cells.entries()) {
|
|
375004
|
+
const shown = (cell2.queryInfo !== undefined || cell2.deriveQueryInfo !== undefined) && await this.showsCellQueryInfo(index, cell2);
|
|
374775
375005
|
if (shown)
|
|
374776
375006
|
shownCells.add(index);
|
|
374777
|
-
const queryInfo = shown ?
|
|
375007
|
+
const queryInfo = shown ? cell2.queryInfo ?? await cell2.deriveQueryInfo?.() : undefined;
|
|
374778
375008
|
notebookCells.push({
|
|
374779
|
-
type:
|
|
374780
|
-
kind:
|
|
374781
|
-
text:
|
|
374782
|
-
markdown:
|
|
374783
|
-
proseLines:
|
|
374784
|
-
codeLine:
|
|
374785
|
-
caption:
|
|
374786
|
-
newSources: this.serializeNewSources(
|
|
375009
|
+
type: cell2.type,
|
|
375010
|
+
kind: cell2.kind,
|
|
375011
|
+
text: cell2.text,
|
|
375012
|
+
markdown: cell2.markdown,
|
|
375013
|
+
proseLines: cell2.proseLines,
|
|
375014
|
+
codeLine: cell2.codeLine,
|
|
375015
|
+
caption: cell2.caption,
|
|
375016
|
+
newSources: this.serializeNewSources(cell2.newSources, index),
|
|
374787
375017
|
queryInfo: queryInfo ? JSON.stringify(queryInfo) : undefined
|
|
374788
375018
|
});
|
|
374789
375019
|
}
|
|
@@ -374831,8 +375061,8 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374831
375061
|
}
|
|
374832
375062
|
async executeNotebookCell(audit, cellIndex, filterParams, bypassFilters, givens, abortSignal, queryMetadataInput) {
|
|
374833
375063
|
const started = performance.now();
|
|
374834
|
-
const
|
|
374835
|
-
const kind = this.notebookFormat() === "malloy" ?
|
|
375064
|
+
const cell2 = this.runnableNotebookCells?.[cellIndex];
|
|
375065
|
+
const kind = this.notebookFormat() === "malloy" ? cell2?.kind ?? "none" : cell2?.type === "markdown" ? "markdown" : "code";
|
|
374836
375066
|
try {
|
|
374837
375067
|
const result = await this.runNotebookCell(audit, cellIndex, filterParams, bypassFilters, givens, abortSignal, queryMetadataInput);
|
|
374838
375068
|
recordNotebookCellExecution(this.notebookFormat(), kind, "ok", performance.now() - started);
|
|
@@ -374855,34 +375085,34 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374855
375085
|
if (cellIndex < 0 || cellIndex >= this.runnableNotebookCells.length) {
|
|
374856
375086
|
throw new BadRequestError(`Cell index ${cellIndex} out of range (0-${this.runnableNotebookCells.length - 1})`);
|
|
374857
375087
|
}
|
|
374858
|
-
const
|
|
374859
|
-
if (
|
|
375088
|
+
const cell2 = this.runnableNotebookCells[cellIndex];
|
|
375089
|
+
if (cell2.type === "markdown") {
|
|
374860
375090
|
return {
|
|
374861
|
-
type:
|
|
374862
|
-
kind:
|
|
374863
|
-
text:
|
|
375091
|
+
type: cell2.type,
|
|
375092
|
+
kind: cell2.kind,
|
|
375093
|
+
text: cell2.text
|
|
374864
375094
|
};
|
|
374865
375095
|
}
|
|
374866
375096
|
let queryName = undefined;
|
|
374867
375097
|
let queryResult = undefined;
|
|
374868
|
-
if (
|
|
374869
|
-
await this.assertNotebookCellOnSurface(cellIndex,
|
|
375098
|
+
if (cell2.runnable) {
|
|
375099
|
+
await this.assertNotebookCellOnSurface(cellIndex, cell2.runnable);
|
|
374870
375100
|
try {
|
|
374871
|
-
let runnableToExecute =
|
|
374872
|
-
let textToExecute =
|
|
374873
|
-
const { graftScope, usesOwnScope } = await this.resolveNotebookCellGraftScope(cellIndex,
|
|
375101
|
+
let runnableToExecute = cell2.runnable;
|
|
375102
|
+
let textToExecute = cell2.text;
|
|
375103
|
+
const { graftScope, usesOwnScope } = await this.resolveNotebookCellGraftScope(cellIndex, cell2.runnable);
|
|
374874
375104
|
if (!graftScope) {
|
|
374875
375105
|
logger.debug("Notebook cell has no graft scope to attach a row-level gate against (no earlier code cell, and this cell has no compiled model of its own)", { modelPath: this.modelPath, cellIndex });
|
|
374876
375106
|
}
|
|
374877
|
-
const effectiveSource = !bypassFilters &&
|
|
375107
|
+
const effectiveSource = !bypassFilters && cell2.modelMaterializer ? extractRunTargetSourceName(cell2.text) : undefined;
|
|
374878
375108
|
const cellFilters = effectiveSource ? this.getFilters(effectiveSource) : [];
|
|
374879
|
-
if (
|
|
374880
|
-
await this.probeEntryPointGates(
|
|
375109
|
+
if (cell2.modelMaterializer && cellFilters.length > 0) {
|
|
375110
|
+
await this.probeEntryPointGates(cell2.runnable, givens ?? {}, graftScope);
|
|
374881
375111
|
}
|
|
374882
375112
|
const filterClause = cellFilters.length > 0 ? buildFilterClause(cellFilters, filterParams ?? {}) : undefined;
|
|
374883
|
-
if (filterClause &&
|
|
374884
|
-
textToExecute = injectFilterRefinement(
|
|
374885
|
-
runnableToExecute =
|
|
375113
|
+
if (filterClause && cell2.modelMaterializer) {
|
|
375114
|
+
textToExecute = injectFilterRefinement(cell2.text, filterClause);
|
|
375115
|
+
runnableToExecute = cell2.modelMaterializer.loadQuery(textToExecute);
|
|
374886
375116
|
const injectedCellFilters = cellFilters.filter((f5) => filterHasValue(f5, filterParams ?? {}));
|
|
374887
375117
|
if (injectedCellFilters.length > 0 && effectiveSource) {
|
|
374888
375118
|
await runnableToExecute.getPreparedQuery();
|
|
@@ -374890,7 +375120,7 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374890
375120
|
}
|
|
374891
375121
|
}
|
|
374892
375122
|
const cellReadGivenNames = await this.givenNamesReadByQuery(runnableToExecute, givens);
|
|
374893
|
-
if (
|
|
375123
|
+
if (cell2.modelMaterializer) {
|
|
374894
375124
|
const textForRecompile = textToExecute;
|
|
374895
375125
|
const ownScopeBinder = usesOwnScope ? this.ownScopeQueryDefBinder((await runnableToExecute.getPreparedQuery())._query, graftScope) : undefined;
|
|
374896
375126
|
runnableToExecute = await this.authorizeAndBindRunnable(runnableToExecute, givens ?? {}, {
|
|
@@ -374901,7 +375131,7 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374901
375131
|
} else {
|
|
374902
375132
|
await this.assertAuthorizedForAllSources(runnableToExecute, givens ?? {});
|
|
374903
375133
|
}
|
|
374904
|
-
await this.assertWithinCarriesCeiling(audit, runnableToExecute, runnableToExecute, await this.resolveAuthorizeSourceFromRunnable(runnableToExecute) ?? extractRunTargetSourceName(
|
|
375134
|
+
await this.assertWithinCarriesCeiling(audit, runnableToExecute, runnableToExecute, await this.resolveAuthorizeSourceFromRunnable(runnableToExecute) ?? extractRunTargetSourceName(cell2.text), givens, undefined);
|
|
374905
375135
|
this.assertFilterGivens(givens);
|
|
374906
375136
|
const cellMaxRows = getMaxQueryRows();
|
|
374907
375137
|
const cellMaxBytes = getMaxResponseBytes();
|
|
@@ -374914,7 +375144,7 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374914
375144
|
usage: Model.statementUsage(queryMetadataInput, this.packageName),
|
|
374915
375145
|
queryMetadata: async (connectionName) => {
|
|
374916
375146
|
const cellCompiledSource = await this.resolveAuthorizeSourceFromRunnable(cellRunnable);
|
|
374917
|
-
return this.resolveQueryMetadata(queryMetadataInput, connectionName, cellCompiledSource ?? extractRunTargetSourceName(
|
|
375147
|
+
return this.resolveQueryMetadata(queryMetadataInput, connectionName, cellCompiledSource ?? extractRunTargetSourceName(cell2.text));
|
|
374918
375148
|
}
|
|
374919
375149
|
});
|
|
374920
375150
|
const query2 = (await runnableToExecute.getPreparedQuery())._query;
|
|
@@ -374925,7 +375155,7 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374925
375155
|
modelDef: this.modelDef,
|
|
374926
375156
|
apiSources: this.sources,
|
|
374927
375157
|
modelGivens: this.givens,
|
|
374928
|
-
source: await this.resolveAuthorizeSourceFromRunnable(cellRunnable) ?? extractRunTargetSourceName(
|
|
375158
|
+
source: await this.resolveAuthorizeSourceFromRunnable(cellRunnable) ?? extractRunTargetSourceName(cell2.text),
|
|
374929
375159
|
givens,
|
|
374930
375160
|
bypassAuthorize: false,
|
|
374931
375161
|
grafts: this.rowLevelFilteredRunnables.get(cellRunnable) ?? [],
|
|
@@ -374968,26 +375198,26 @@ run: ${sourceName ? `${quoteMalloyIdentifier2(sourceName)} -> ` : ""}${quoteMall
|
|
|
374968
375198
|
});
|
|
374969
375199
|
return {
|
|
374970
375200
|
type: "code",
|
|
374971
|
-
kind:
|
|
374972
|
-
text:
|
|
374973
|
-
markdown:
|
|
374974
|
-
proseLines:
|
|
374975
|
-
codeLine:
|
|
374976
|
-
caption:
|
|
375201
|
+
kind: cell2.kind,
|
|
375202
|
+
text: cell2.text,
|
|
375203
|
+
markdown: cell2.markdown,
|
|
375204
|
+
proseLines: cell2.proseLines,
|
|
375205
|
+
codeLine: cell2.codeLine,
|
|
375206
|
+
caption: cell2.caption
|
|
374977
375207
|
};
|
|
374978
375208
|
}
|
|
374979
375209
|
}
|
|
374980
375210
|
return {
|
|
374981
|
-
type:
|
|
374982
|
-
kind:
|
|
374983
|
-
text:
|
|
374984
|
-
markdown:
|
|
374985
|
-
proseLines:
|
|
374986
|
-
codeLine:
|
|
374987
|
-
caption:
|
|
375211
|
+
type: cell2.type,
|
|
375212
|
+
kind: cell2.kind,
|
|
375213
|
+
text: cell2.text,
|
|
375214
|
+
markdown: cell2.markdown,
|
|
375215
|
+
proseLines: cell2.proseLines,
|
|
375216
|
+
codeLine: cell2.codeLine,
|
|
375217
|
+
caption: cell2.caption,
|
|
374988
375218
|
queryName,
|
|
374989
375219
|
result: queryResult,
|
|
374990
|
-
newSources: this.serializeNewSources(
|
|
375220
|
+
newSources: this.serializeNewSources(cell2.newSources, cellIndex)
|
|
374991
375221
|
};
|
|
374992
375222
|
}
|
|
374993
375223
|
static getModelRuntime(...args) {
|
|
@@ -376118,9 +376348,9 @@ function lintNotebookText(modelPath, text) {
|
|
|
376118
376348
|
const nodeText = (node) => node.start && node.stop ? text.slice(map[node.start.startIndex], map[node.stop.stopIndex + 1]) : "";
|
|
376119
376349
|
const lineOfNode = (node) => node.start?.line ?? 1;
|
|
376120
376350
|
const findings = [];
|
|
376121
|
-
const add = (line,
|
|
376351
|
+
const add = (line, code2, message, severity = "warn") => findings.push({
|
|
376122
376352
|
line,
|
|
376123
|
-
code,
|
|
376353
|
+
code: code2,
|
|
376124
376354
|
severity,
|
|
376125
376355
|
message: `Line ${line}: ${message}`
|
|
376126
376356
|
});
|
|
@@ -376368,10 +376598,10 @@ function lintNotebookText(modelPath, text) {
|
|
|
376368
376598
|
}
|
|
376369
376599
|
}
|
|
376370
376600
|
function tagFinding(tagNote) {
|
|
376371
|
-
const [
|
|
376601
|
+
const [code2, message] = tagFindingText(tagNote.text);
|
|
376372
376602
|
return {
|
|
376373
376603
|
line: tagNote.line,
|
|
376374
|
-
code,
|
|
376604
|
+
code: code2,
|
|
376375
376605
|
severity: "error",
|
|
376376
376606
|
message: `Line ${tagNote.line}: ${message}`
|
|
376377
376607
|
};
|
|
@@ -377898,11 +378128,11 @@ var init_package2 = __esm(() => {
|
|
|
377898
378128
|
}));
|
|
377899
378129
|
}
|
|
377900
378130
|
formatInvalidPreaggregatePolicy() {
|
|
377901
|
-
return this.preaggregateMessages((
|
|
378131
|
+
return this.preaggregateMessages((code2) => !PREAGG_WARN_ONLY.has(code2)).join(`
|
|
377902
378132
|
`);
|
|
377903
378133
|
}
|
|
377904
378134
|
preaggregateAccessWarnings() {
|
|
377905
|
-
return this.preaggregateFindings((
|
|
378135
|
+
return this.preaggregateFindings((code2) => PREAGG_WARN_ONLY.has(code2)).map(({ modelPath, violation }) => ({
|
|
377906
378136
|
model: modelPath,
|
|
377907
378137
|
subject: violation.fieldName ?? violation.sourceName,
|
|
377908
378138
|
message: violation.message
|
|
@@ -378674,8 +378904,8 @@ var init_package2 = __esm(() => {
|
|
|
378674
378904
|
try {
|
|
378675
378905
|
await fs17.stat(packageConfigPath);
|
|
378676
378906
|
} catch (error) {
|
|
378677
|
-
const
|
|
378678
|
-
if (
|
|
378907
|
+
const code2 = error.code;
|
|
378908
|
+
if (code2 !== "ENOENT" && code2 !== "ENOTDIR")
|
|
378679
378909
|
throw error;
|
|
378680
378910
|
logger.error(`Can't find ${packageConfigPath}`);
|
|
378681
378911
|
throw new PackageNotFoundError(`Package manifest for ${packagePath} does not exist.`);
|
|
@@ -378773,8 +379003,8 @@ function blankSpans(text, cells) {
|
|
|
378773
379003
|
if (cells.length === 0)
|
|
378774
379004
|
return text;
|
|
378775
379005
|
const units = text.split("");
|
|
378776
|
-
for (const
|
|
378777
|
-
const span = cellOffsets.get(
|
|
379006
|
+
for (const cell2 of cells) {
|
|
379007
|
+
const span = cellOffsets.get(cell2);
|
|
378778
379008
|
if (!span)
|
|
378779
379009
|
throw new Error("restricted cell has no recorded span");
|
|
378780
379010
|
const [start, end] = span;
|
|
@@ -378846,15 +379076,15 @@ async function compileDocument(input) {
|
|
|
378846
379076
|
if (read.error) {
|
|
378847
379077
|
return { problems: [cellsUnreadableProblem(read.error, "")] };
|
|
378848
379078
|
}
|
|
378849
|
-
const
|
|
379079
|
+
const code2 = read.cells.filter((cell2) => cell2.type === "code");
|
|
378850
379080
|
const restrictedCells = new Set;
|
|
378851
379081
|
const tainted = new Set;
|
|
378852
379082
|
const mentionsTainted = (text) => tainted.size > 0 && [...scanIdentifiers(text)].some((name) => tainted.has(name));
|
|
378853
|
-
for (const
|
|
378854
|
-
if (mentionsTainted(
|
|
378855
|
-
restrictedCells.add(
|
|
378856
|
-
if (
|
|
378857
|
-
for (const name of declaredNames(
|
|
379083
|
+
for (const cell2 of code2) {
|
|
379084
|
+
if (mentionsTainted(cell2.text) || await denied(gates, cell2.text)) {
|
|
379085
|
+
restrictedCells.add(cell2);
|
|
379086
|
+
if (cell2.kind === "definition") {
|
|
379087
|
+
for (const name of declaredNames(cell2.text))
|
|
378858
379088
|
tainted.add(name);
|
|
378859
379089
|
}
|
|
378860
379090
|
}
|
|
@@ -378867,7 +379097,7 @@ async function compileDocument(input) {
|
|
|
378867
379097
|
restrictedTiles.add(normalizeTileExpression(expression));
|
|
378868
379098
|
}
|
|
378869
379099
|
}
|
|
378870
|
-
const definitions =
|
|
379100
|
+
const definitions = code2.filter((cell2) => cell2.kind === "definition" && !restrictedCells.has(cell2)).map((cell2) => cell2.text).join(`
|
|
378871
379101
|
`);
|
|
378872
379102
|
const unparsedTiles = new Set;
|
|
378873
379103
|
const tileProblems = [];
|
|
@@ -378908,9 +379138,9 @@ run: ${expression}`);
|
|
|
378908
379138
|
});
|
|
378909
379139
|
}
|
|
378910
379140
|
};
|
|
378911
|
-
for (const
|
|
378912
|
-
if (
|
|
378913
|
-
await checkBoundary(
|
|
379141
|
+
for (const cell2 of code2) {
|
|
379142
|
+
if (cell2.kind === "query" && !restrictedCells.has(cell2)) {
|
|
379143
|
+
await checkBoundary(cell2.text, cell2.startLine);
|
|
378914
379144
|
}
|
|
378915
379145
|
}
|
|
378916
379146
|
for (const expression of tileExpressions) {
|
|
@@ -378922,7 +379152,7 @@ run: ${expression}`);
|
|
|
378922
379152
|
if (boundaryProblems.length > 0)
|
|
378923
379153
|
return { problems: boundaryProblems };
|
|
378924
379154
|
const readable2 = [
|
|
378925
|
-
...
|
|
379155
|
+
...code2.filter((cell2) => cell2.kind === "query" && !restrictedCells.has(cell2)).map((cell2) => cell2.text),
|
|
378926
379156
|
...tileExpressions.filter((expression) => {
|
|
378927
379157
|
const key = normalizeTileExpression(expression);
|
|
378928
379158
|
return !restrictedTiles.has(key) && !unparsedTiles.has(key);
|
|
@@ -378968,19 +379198,19 @@ run: ${expression}`);
|
|
|
378968
379198
|
});
|
|
378969
379199
|
}
|
|
378970
379200
|
};
|
|
378971
|
-
for (const
|
|
378972
|
-
if (
|
|
379201
|
+
for (const cell2 of code2) {
|
|
379202
|
+
if (cell2.kind !== "query" || restrictedCells.has(cell2))
|
|
378973
379203
|
continue;
|
|
378974
|
-
const runnable = extended.loadRestrictedQuery(
|
|
379204
|
+
const runnable = extended.loadRestrictedQuery(cell2.text);
|
|
378975
379205
|
let denied2 = false;
|
|
378976
379206
|
await settle2(runnable, () => {
|
|
378977
379207
|
denied2 = true;
|
|
378978
|
-
restrictedCells.add(
|
|
379208
|
+
restrictedCells.add(cell2);
|
|
378979
379209
|
});
|
|
378980
379210
|
if (denied2)
|
|
378981
379211
|
continue;
|
|
378982
379212
|
try {
|
|
378983
|
-
await compiledBoundary(runnable, await runnable.getPreparedQuery(),
|
|
379213
|
+
await compiledBoundary(runnable, await runnable.getPreparedQuery(), cell2.text);
|
|
378984
379214
|
} catch (error) {
|
|
378985
379215
|
if (!(error instanceof MalloyError11))
|
|
378986
379216
|
throw error;
|
|
@@ -379006,7 +379236,7 @@ run: ${expression}`);
|
|
|
379006
379236
|
const spans = [...restrictedCells];
|
|
379007
379237
|
const problems = [...tileProblems, ...model.problems].filter((problem) => {
|
|
379008
379238
|
const line = problemLine(problem);
|
|
379009
|
-
return line === undefined || !spans.some((
|
|
379239
|
+
return line === undefined || !spans.some((cell2) => line >= cell2.startLine && line <= cell2.endLine);
|
|
379010
379240
|
});
|
|
379011
379241
|
const slug = modelName.replace(/^.*\//, "").replace(/\.malloy$/, "");
|
|
379012
379242
|
const path21 = `${slug}.malloy`;
|
|
@@ -379017,19 +379247,19 @@ run: ${expression}`);
|
|
|
379017
379247
|
]
|
|
379018
379248
|
] : [])));
|
|
379019
379249
|
const manifest = buildReportManifest({ ...facts, compiledTileGivens: compiledTiles }, { restrictedTiles });
|
|
379020
|
-
const cells = read.cells.filter((
|
|
379021
|
-
const restricted = restrictedCells.has(
|
|
379022
|
-
if (
|
|
379023
|
-
return { type: "markdown", kind: "markdown", text:
|
|
379250
|
+
const cells = read.cells.filter((cell2) => cell2.kind === "definition").map((cell2) => {
|
|
379251
|
+
const restricted = restrictedCells.has(cell2);
|
|
379252
|
+
if (cell2.kind === "markdown") {
|
|
379253
|
+
return { type: "markdown", kind: "markdown", text: cell2.text };
|
|
379024
379254
|
}
|
|
379025
379255
|
return {
|
|
379026
379256
|
type: "code",
|
|
379027
|
-
kind:
|
|
379028
|
-
text:
|
|
379029
|
-
...
|
|
379030
|
-
...
|
|
379031
|
-
...
|
|
379032
|
-
...
|
|
379257
|
+
kind: cell2.kind,
|
|
379258
|
+
text: cell2.text,
|
|
379259
|
+
...cell2.markdown !== undefined && { markdown: cell2.markdown },
|
|
379260
|
+
...cell2.proseLines && { proseLines: cell2.proseLines },
|
|
379261
|
+
...cell2.codeLine !== undefined && { codeLine: cell2.codeLine },
|
|
379262
|
+
...cell2.caption !== undefined && { caption: cell2.caption },
|
|
379033
379263
|
...restricted && { restricted: true }
|
|
379034
379264
|
};
|
|
379035
379265
|
});
|
|
@@ -379562,11 +379792,11 @@ function problemCollector(tagProblems) {
|
|
|
379562
379792
|
};
|
|
379563
379793
|
return { problems, collect };
|
|
379564
379794
|
}
|
|
379565
|
-
function warningAsProblem(warning,
|
|
379795
|
+
function warningAsProblem(warning, code2) {
|
|
379566
379796
|
return {
|
|
379567
379797
|
severity: warning.severity ?? "warn",
|
|
379568
379798
|
message: warning.subject ? `${warning.subject}: ${warning.message}` : warning.message,
|
|
379569
|
-
code
|
|
379799
|
+
code: code2
|
|
379570
379800
|
};
|
|
379571
379801
|
}
|
|
379572
379802
|
var getCompileRefusalsCounter, COMPILE_SCOPES;
|
|
@@ -381334,8 +381564,8 @@ class Environment {
|
|
|
381334
381564
|
try {
|
|
381335
381565
|
return await fs22.promises.readFile(target, "utf8");
|
|
381336
381566
|
} catch (error) {
|
|
381337
|
-
const
|
|
381338
|
-
if (
|
|
381567
|
+
const code2 = error.code;
|
|
381568
|
+
if (code2 !== "ENOENT" && code2 !== "ENOTDIR")
|
|
381339
381569
|
throw error;
|
|
381340
381570
|
return;
|
|
381341
381571
|
}
|
|
@@ -381345,8 +381575,8 @@ class Environment {
|
|
|
381345
381575
|
let dir = path25.dirname(target);
|
|
381346
381576
|
while (dir.startsWith(packageRoot)) {
|
|
381347
381577
|
const stat7 = await fs22.promises.stat(dir).catch((error) => {
|
|
381348
|
-
const
|
|
381349
|
-
if (
|
|
381578
|
+
const code2 = error.code;
|
|
381579
|
+
if (code2 === "ENOENT" || code2 === "ENOTDIR")
|
|
381350
381580
|
return;
|
|
381351
381581
|
throw error;
|
|
381352
381582
|
});
|
|
@@ -382959,8 +383189,9 @@ class EnvironmentStore {
|
|
|
382959
383189
|
if (!versions) {
|
|
382960
383190
|
throw new Error("package versions are not available in this environment");
|
|
382961
383191
|
}
|
|
382962
|
-
|
|
382963
|
-
|
|
383192
|
+
const location = this.isLocalPath(configured.location) ? this.resolveLocalPath(configured.location) : configured.location;
|
|
383193
|
+
await versions.publish(configured.name, (stagingPath) => this.downloadPackageInto(environmentName, configured.name, location, stagingPath), {
|
|
383194
|
+
sourceLocation: location,
|
|
382964
383195
|
promotion: getVersionPromotionMode(),
|
|
382965
383196
|
validate: (loaded2) => formatPublishRejections(loaded2)
|
|
382966
383197
|
});
|
|
@@ -383164,8 +383395,7 @@ class EnvironmentStore {
|
|
|
383164
383395
|
});
|
|
383165
383396
|
}
|
|
383166
383397
|
}
|
|
383167
|
-
async downloadPackageInto(environmentName, packageName,
|
|
383168
|
-
const packageLocation = this.isLocalPath(location) ? this.resolveLocalPath(location) : location;
|
|
383398
|
+
async downloadPackageInto(environmentName, packageName, packageLocation, targetPath) {
|
|
383169
383399
|
const isCompressedFile = packageLocation.endsWith(".zip");
|
|
383170
383400
|
if (packageLocation.startsWith("https://") || packageLocation.startsWith("git@")) {
|
|
383171
383401
|
await this.downloadGitHubDirectory(packageLocation, targetPath);
|
|
@@ -383911,8 +384141,8 @@ class EnvironmentStore {
|
|
|
383911
384141
|
await fs23.promises.symlink(absoluteSourcePath, absolutePackagePath, linkType);
|
|
383912
384142
|
logger.info(`In-place mount (watch mode): linked package "${packageDir}" -> "${absoluteSourcePath}" (${++mountedCount}/${totalPackages})`);
|
|
383913
384143
|
} catch (linkError) {
|
|
383914
|
-
const
|
|
383915
|
-
logger.warn(`In-place mount failed for package "${packageDir}" (${
|
|
384144
|
+
const code2 = linkError?.code ?? String(linkError);
|
|
384145
|
+
logger.warn(`In-place mount failed for package "${packageDir}" (${code2}); falling back to a copy. Source-edit live reload is disabled for this package.`);
|
|
383916
384146
|
await clearMountTarget(absolutePackagePath);
|
|
383917
384147
|
await fs23.promises.mkdir(absolutePackagePath, {
|
|
383918
384148
|
recursive: true
|
|
@@ -384727,8 +384957,8 @@ function ensureMcpConfig(options) {
|
|
|
384727
384957
|
fs24.writeFileSync(file, body, { encoding: "utf8", flag: "wx" });
|
|
384728
384958
|
return { action: "created", file };
|
|
384729
384959
|
} catch (error) {
|
|
384730
|
-
const
|
|
384731
|
-
if (
|
|
384960
|
+
const code2 = error?.code;
|
|
384961
|
+
if (code2 === "EEXIST") {
|
|
384732
384962
|
const existingUrl = conflictingMalloyUrl(file, endpoint);
|
|
384733
384963
|
return {
|
|
384734
384964
|
action: "exists",
|
|
@@ -389994,8 +390224,8 @@ var WSContext = class {
|
|
|
389994
390224
|
}
|
|
389995
390225
|
url;
|
|
389996
390226
|
protocol;
|
|
389997
|
-
close(
|
|
389998
|
-
this.#init.close(
|
|
390227
|
+
close(code2, reason) {
|
|
390228
|
+
this.#init.close(code2, reason);
|
|
389999
390229
|
}
|
|
390000
390230
|
}, defineWebSocketHelper = (handler) => {
|
|
390001
390231
|
return (...args) => {
|
|
@@ -390065,7 +390295,7 @@ function writeFromReadableStream(stream4, writable) {
|
|
|
390065
390295
|
return;
|
|
390066
390296
|
return writeFromReadableStreamDefaultReader(stream4.getReader(), writable);
|
|
390067
390297
|
}
|
|
390068
|
-
var RequestError, nonJoinedHeaders, validHeaderName, isHttpWhitespace = (
|
|
390298
|
+
var RequestError, nonJoinedHeaders, validHeaderName, isHttpWhitespace = (code2) => code2 === 9 || code2 === 10 || code2 === 13 || code2 === 32, normalizeHeaderValue = (value) => {
|
|
390069
390299
|
if (!isHttpWhitespace(value.charCodeAt(0)) && !isHttpWhitespace(value.charCodeAt(value.length - 1)))
|
|
390070
390300
|
return value;
|
|
390071
390301
|
let start = 0;
|
|
@@ -391252,8 +391482,8 @@ var init_dist5 = __esm(() => {
|
|
|
391252
391482
|
ws2.on("message", bufferMessage);
|
|
391253
391483
|
const ctx = {
|
|
391254
391484
|
binaryType: "arraybuffer",
|
|
391255
|
-
close(
|
|
391256
|
-
ws2.close(
|
|
391485
|
+
close(code2, reason) {
|
|
391486
|
+
ws2.close(code2, reason);
|
|
391257
391487
|
},
|
|
391258
391488
|
protocol: ws2.protocol,
|
|
391259
391489
|
raw: ws2,
|
|
@@ -391285,10 +391515,10 @@ var init_dist5 = __esm(() => {
|
|
|
391285
391515
|
ws2.on("message", (data, isBinary) => {
|
|
391286
391516
|
handleMessage(data, isBinary);
|
|
391287
391517
|
});
|
|
391288
|
-
ws2.on("close", (
|
|
391518
|
+
ws2.on("close", (code2, reason) => {
|
|
391289
391519
|
try {
|
|
391290
391520
|
events?.onClose?.(new CloseEvent("close", {
|
|
391291
|
-
code,
|
|
391521
|
+
code: code2,
|
|
391292
391522
|
reason: reason.toString()
|
|
391293
391523
|
}), ctx);
|
|
391294
391524
|
} catch (e2) {
|
|
@@ -396789,20 +397019,20 @@ var init_types4 = __esm(() => {
|
|
|
396789
397019
|
CreateTaskResultSchema
|
|
396790
397020
|
]);
|
|
396791
397021
|
McpError = class McpError extends Error {
|
|
396792
|
-
constructor(
|
|
396793
|
-
super(`MCP error ${
|
|
396794
|
-
this.code =
|
|
397022
|
+
constructor(code2, message, data) {
|
|
397023
|
+
super(`MCP error ${code2}: ${message}`);
|
|
397024
|
+
this.code = code2;
|
|
396795
397025
|
this.data = data;
|
|
396796
397026
|
this.name = "McpError";
|
|
396797
397027
|
}
|
|
396798
|
-
static fromError(
|
|
396799
|
-
if (
|
|
397028
|
+
static fromError(code2, message, data) {
|
|
397029
|
+
if (code2 === ErrorCode.UrlElicitationRequired && data) {
|
|
396800
397030
|
const errorData = data;
|
|
396801
397031
|
if (errorData.elicitations) {
|
|
396802
397032
|
return new UrlElicitationRequiredError(errorData.elicitations, message);
|
|
396803
397033
|
}
|
|
396804
397034
|
}
|
|
396805
|
-
return new McpError(
|
|
397035
|
+
return new McpError(code2, message, data);
|
|
396806
397036
|
}
|
|
396807
397037
|
};
|
|
396808
397038
|
UrlElicitationRequiredError = class UrlElicitationRequiredError extends McpError {
|
|
@@ -396863,8 +397093,8 @@ class WebStandardStreamableHTTPServerTransport {
|
|
|
396863
397093
|
}
|
|
396864
397094
|
this._started = true;
|
|
396865
397095
|
}
|
|
396866
|
-
createJsonErrorResponse(status,
|
|
396867
|
-
const error2 = { code, message };
|
|
397096
|
+
createJsonErrorResponse(status, code2, message, options) {
|
|
397097
|
+
const error2 = { code: code2, message };
|
|
396868
397098
|
if (options?.data !== undefined) {
|
|
396869
397099
|
error2.data = options.data;
|
|
396870
397100
|
}
|
|
@@ -400132,9 +400362,9 @@ var require_code = __commonJS((exports) => {
|
|
|
400132
400362
|
exports.Name = Name;
|
|
400133
400363
|
|
|
400134
400364
|
class _Code extends _CodeOrName {
|
|
400135
|
-
constructor(
|
|
400365
|
+
constructor(code2) {
|
|
400136
400366
|
super();
|
|
400137
|
-
this._items = typeof
|
|
400367
|
+
this._items = typeof code2 === "string" ? [code2] : code2;
|
|
400138
400368
|
}
|
|
400139
400369
|
toString() {
|
|
400140
400370
|
return this.str;
|
|
@@ -400161,13 +400391,13 @@ var require_code = __commonJS((exports) => {
|
|
|
400161
400391
|
exports._Code = _Code;
|
|
400162
400392
|
exports.nil = new _Code("");
|
|
400163
400393
|
function _3(strs, ...args) {
|
|
400164
|
-
const
|
|
400394
|
+
const code2 = [strs[0]];
|
|
400165
400395
|
let i2 = 0;
|
|
400166
400396
|
while (i2 < args.length) {
|
|
400167
|
-
addCodeArg(
|
|
400168
|
-
|
|
400397
|
+
addCodeArg(code2, args[i2]);
|
|
400398
|
+
code2.push(strs[++i2]);
|
|
400169
400399
|
}
|
|
400170
|
-
return new _Code(
|
|
400400
|
+
return new _Code(code2);
|
|
400171
400401
|
}
|
|
400172
400402
|
exports._ = _3;
|
|
400173
400403
|
var plus = new _Code("+");
|
|
@@ -400183,13 +400413,13 @@ var require_code = __commonJS((exports) => {
|
|
|
400183
400413
|
return new _Code(expr);
|
|
400184
400414
|
}
|
|
400185
400415
|
exports.str = str2;
|
|
400186
|
-
function addCodeArg(
|
|
400416
|
+
function addCodeArg(code2, arg) {
|
|
400187
400417
|
if (arg instanceof _Code)
|
|
400188
|
-
|
|
400418
|
+
code2.push(...arg._items);
|
|
400189
400419
|
else if (arg instanceof Name)
|
|
400190
|
-
|
|
400420
|
+
code2.push(arg);
|
|
400191
400421
|
else
|
|
400192
|
-
|
|
400422
|
+
code2.push(interpolate(arg));
|
|
400193
400423
|
}
|
|
400194
400424
|
exports.addCodeArg = addCodeArg;
|
|
400195
400425
|
function optimize(expr) {
|
|
@@ -400374,7 +400604,7 @@ var require_scope = __commonJS((exports) => {
|
|
|
400374
400604
|
}, usedValues, getCode);
|
|
400375
400605
|
}
|
|
400376
400606
|
_reduceValues(values, valueCode, usedValues = {}, getCode) {
|
|
400377
|
-
let
|
|
400607
|
+
let code2 = code_1.nil;
|
|
400378
400608
|
for (const prefix in values) {
|
|
400379
400609
|
const vs2 = values[prefix];
|
|
400380
400610
|
if (!vs2)
|
|
@@ -400387,16 +400617,16 @@ var require_scope = __commonJS((exports) => {
|
|
|
400387
400617
|
let c3 = valueCode(name);
|
|
400388
400618
|
if (c3) {
|
|
400389
400619
|
const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
|
|
400390
|
-
|
|
400620
|
+
code2 = (0, code_1._)`${code2}${def} ${name} = ${c3};${this.opts._n}`;
|
|
400391
400621
|
} else if (c3 = getCode === null || getCode === undefined ? undefined : getCode(name)) {
|
|
400392
|
-
|
|
400622
|
+
code2 = (0, code_1._)`${code2}${c3}${this.opts._n}`;
|
|
400393
400623
|
} else {
|
|
400394
400624
|
throw new ValueError(name);
|
|
400395
400625
|
}
|
|
400396
400626
|
nameSet.set(name, UsedValueState.Completed);
|
|
400397
400627
|
});
|
|
400398
400628
|
}
|
|
400399
|
-
return
|
|
400629
|
+
return code2;
|
|
400400
400630
|
}
|
|
400401
400631
|
}
|
|
400402
400632
|
exports.ValueScope = ValueScope;
|
|
@@ -400561,9 +400791,9 @@ var require_codegen2 = __commonJS((exports) => {
|
|
|
400561
400791
|
}
|
|
400562
400792
|
|
|
400563
400793
|
class AnyCode extends Node {
|
|
400564
|
-
constructor(
|
|
400794
|
+
constructor(code2) {
|
|
400565
400795
|
super();
|
|
400566
|
-
this.code =
|
|
400796
|
+
this.code = code2;
|
|
400567
400797
|
}
|
|
400568
400798
|
render({ _n: _n2 }) {
|
|
400569
400799
|
return `${this.code};` + _n2;
|
|
@@ -400586,7 +400816,7 @@ var require_codegen2 = __commonJS((exports) => {
|
|
|
400586
400816
|
this.nodes = nodes;
|
|
400587
400817
|
}
|
|
400588
400818
|
render(opts) {
|
|
400589
|
-
return this.nodes.reduce((
|
|
400819
|
+
return this.nodes.reduce((code2, n) => code2 + n.render(opts), "");
|
|
400590
400820
|
}
|
|
400591
400821
|
optimizeNodes() {
|
|
400592
400822
|
const { nodes } = this;
|
|
@@ -400638,10 +400868,10 @@ var require_codegen2 = __commonJS((exports) => {
|
|
|
400638
400868
|
this.condition = condition;
|
|
400639
400869
|
}
|
|
400640
400870
|
render(opts) {
|
|
400641
|
-
let
|
|
400871
|
+
let code2 = `if(${this.condition})` + super.render(opts);
|
|
400642
400872
|
if (this.else)
|
|
400643
|
-
|
|
400644
|
-
return
|
|
400873
|
+
code2 += "else " + this.else.render(opts);
|
|
400874
|
+
return code2;
|
|
400645
400875
|
}
|
|
400646
400876
|
optimizeNodes() {
|
|
400647
400877
|
super.optimizeNodes();
|
|
@@ -400769,12 +400999,12 @@ var require_codegen2 = __commonJS((exports) => {
|
|
|
400769
400999
|
|
|
400770
401000
|
class Try extends BlockNode {
|
|
400771
401001
|
render(opts) {
|
|
400772
|
-
let
|
|
401002
|
+
let code2 = "try" + super.render(opts);
|
|
400773
401003
|
if (this.catch)
|
|
400774
|
-
|
|
401004
|
+
code2 += this.catch.render(opts);
|
|
400775
401005
|
if (this.finally)
|
|
400776
|
-
|
|
400777
|
-
return
|
|
401006
|
+
code2 += this.finally.render(opts);
|
|
401007
|
+
return code2;
|
|
400778
401008
|
}
|
|
400779
401009
|
optimizeNodes() {
|
|
400780
401010
|
var _a, _b;
|
|
@@ -400883,18 +401113,18 @@ var require_codegen2 = __commonJS((exports) => {
|
|
|
400883
401113
|
return this;
|
|
400884
401114
|
}
|
|
400885
401115
|
object(...keyValues) {
|
|
400886
|
-
const
|
|
401116
|
+
const code2 = ["{"];
|
|
400887
401117
|
for (const [key2, value] of keyValues) {
|
|
400888
|
-
if (
|
|
400889
|
-
|
|
400890
|
-
|
|
401118
|
+
if (code2.length > 1)
|
|
401119
|
+
code2.push(",");
|
|
401120
|
+
code2.push(key2);
|
|
400891
401121
|
if (key2 !== value || this.opts.es5) {
|
|
400892
|
-
|
|
400893
|
-
(0, code_1.addCodeArg)(
|
|
401122
|
+
code2.push(":");
|
|
401123
|
+
(0, code_1.addCodeArg)(code2, value);
|
|
400894
401124
|
}
|
|
400895
401125
|
}
|
|
400896
|
-
|
|
400897
|
-
return new code_1._Code(
|
|
401126
|
+
code2.push("}");
|
|
401127
|
+
return new code_1._Code(code2);
|
|
400898
401128
|
}
|
|
400899
401129
|
if(condition, thenBody, elseBody) {
|
|
400900
401130
|
this._blockNode(new If(condition));
|
|
@@ -403132,22 +403362,22 @@ var require_utils96 = __commonJS((exports, module) => {
|
|
|
403132
403362
|
}
|
|
403133
403363
|
function stringArrayToHexStripped(input) {
|
|
403134
403364
|
let acc = "";
|
|
403135
|
-
let
|
|
403365
|
+
let code2 = 0;
|
|
403136
403366
|
let i2 = 0;
|
|
403137
403367
|
for (i2 = 0;i2 < input.length; i2++) {
|
|
403138
|
-
|
|
403139
|
-
if (
|
|
403368
|
+
code2 = input[i2].charCodeAt(0);
|
|
403369
|
+
if (code2 === 48) {
|
|
403140
403370
|
continue;
|
|
403141
403371
|
}
|
|
403142
|
-
if (!(
|
|
403372
|
+
if (!(code2 >= 48 && code2 <= 57 || code2 >= 65 && code2 <= 70 || code2 >= 97 && code2 <= 102)) {
|
|
403143
403373
|
return "";
|
|
403144
403374
|
}
|
|
403145
403375
|
acc += input[i2];
|
|
403146
403376
|
break;
|
|
403147
403377
|
}
|
|
403148
403378
|
for (i2 += 1;i2 < input.length; i2++) {
|
|
403149
|
-
|
|
403150
|
-
if (!(
|
|
403379
|
+
code2 = input[i2].charCodeAt(0);
|
|
403380
|
+
if (!(code2 >= 48 && code2 <= 57 || code2 >= 65 && code2 <= 70 || code2 >= 97 && code2 <= 102)) {
|
|
403151
403381
|
return "";
|
|
403152
403382
|
}
|
|
403153
403383
|
acc += input[i2];
|
|
@@ -403407,15 +403637,15 @@ var require_utils96 = __commonJS((exports, module) => {
|
|
|
403407
403637
|
if (isPathCharacter(ch)) {
|
|
403408
403638
|
output += ch;
|
|
403409
403639
|
} else {
|
|
403410
|
-
const
|
|
403411
|
-
if (
|
|
403412
|
-
output += isEscapeSafe(
|
|
403413
|
-
} else if (
|
|
403414
|
-
output += percentEncodeNonAscii(
|
|
403415
|
-
} else if (
|
|
403640
|
+
const code2 = input.charCodeAt(i2);
|
|
403641
|
+
if (code2 < 128) {
|
|
403642
|
+
output += isEscapeSafe(code2) ? ch : BYTE_HEX[code2];
|
|
403643
|
+
} else if (code2 < 55296 || code2 > 57343) {
|
|
403644
|
+
output += percentEncodeNonAscii(code2);
|
|
403645
|
+
} else if (code2 <= 56319 && i2 + 1 < input.length) {
|
|
403416
403646
|
const low = input.charCodeAt(i2 + 1);
|
|
403417
403647
|
if (low >= 56320 && low <= 57343) {
|
|
403418
|
-
output += percentEncodeNonAscii(65536 + (
|
|
403648
|
+
output += percentEncodeNonAscii(65536 + (code2 - 55296 << 10) + (low - 56320));
|
|
403419
403649
|
i2++;
|
|
403420
403650
|
} else {
|
|
403421
403651
|
output += percentEncodeNonAscii(65533);
|
|
@@ -403446,15 +403676,15 @@ var require_utils96 = __commonJS((exports, module) => {
|
|
|
403446
403676
|
if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
|
|
403447
403677
|
output += ch;
|
|
403448
403678
|
} else {
|
|
403449
|
-
const
|
|
403450
|
-
if (
|
|
403451
|
-
output += BYTE_HEX[
|
|
403452
|
-
} else if (
|
|
403453
|
-
output += percentEncodeNonAscii(
|
|
403454
|
-
} else if (
|
|
403679
|
+
const code2 = input.charCodeAt(i2);
|
|
403680
|
+
if (code2 < 128) {
|
|
403681
|
+
output += BYTE_HEX[code2];
|
|
403682
|
+
} else if (code2 < 55296 || code2 > 57343) {
|
|
403683
|
+
output += percentEncodeNonAscii(code2);
|
|
403684
|
+
} else if (code2 <= 56319 && i2 + 1 < input.length) {
|
|
403455
403685
|
const low = input.charCodeAt(i2 + 1);
|
|
403456
403686
|
if (low >= 56320 && low <= 57343) {
|
|
403457
|
-
output += percentEncodeNonAscii(65536 + (
|
|
403687
|
+
output += percentEncodeNonAscii(65536 + (code2 - 55296 << 10) + (low - 56320));
|
|
403458
403688
|
i2++;
|
|
403459
403689
|
} else {
|
|
403460
403690
|
output += percentEncodeNonAscii(65533);
|
|
@@ -403481,15 +403711,15 @@ var require_utils96 = __commonJS((exports, module) => {
|
|
|
403481
403711
|
if (isAllowed(ch)) {
|
|
403482
403712
|
output += ch;
|
|
403483
403713
|
} else {
|
|
403484
|
-
const
|
|
403485
|
-
if (
|
|
403486
|
-
output += BYTE_HEX[
|
|
403487
|
-
} else if (
|
|
403488
|
-
output += percentEncodeNonAscii(
|
|
403489
|
-
} else if (
|
|
403714
|
+
const code2 = input.charCodeAt(i2);
|
|
403715
|
+
if (code2 < 128) {
|
|
403716
|
+
output += BYTE_HEX[code2];
|
|
403717
|
+
} else if (code2 < 55296 || code2 > 57343) {
|
|
403718
|
+
output += percentEncodeNonAscii(code2);
|
|
403719
|
+
} else if (code2 <= 56319 && i2 + 1 < input.length) {
|
|
403490
403720
|
const low = input.charCodeAt(i2 + 1);
|
|
403491
403721
|
if (low >= 56320 && low <= 57343) {
|
|
403492
|
-
output += percentEncodeNonAscii(65536 + (
|
|
403722
|
+
output += percentEncodeNonAscii(65536 + (code2 - 55296 << 10) + (low - 56320));
|
|
403493
403723
|
i2++;
|
|
403494
403724
|
} else {
|
|
403495
403725
|
output += percentEncodeNonAscii(65533);
|
|
@@ -403534,15 +403764,15 @@ var require_utils96 = __commonJS((exports, module) => {
|
|
|
403534
403764
|
if (isQueryFragmentCharacter(ch)) {
|
|
403535
403765
|
output += ch;
|
|
403536
403766
|
} else {
|
|
403537
|
-
const
|
|
403538
|
-
if (
|
|
403539
|
-
output += isEscapeSafe(
|
|
403540
|
-
} else if (
|
|
403541
|
-
output += percentEncodeNonAscii(
|
|
403542
|
-
} else if (
|
|
403767
|
+
const code2 = input.charCodeAt(i2);
|
|
403768
|
+
if (code2 < 128) {
|
|
403769
|
+
output += isEscapeSafe(code2) ? ch : BYTE_HEX[code2];
|
|
403770
|
+
} else if (code2 < 55296 || code2 > 57343) {
|
|
403771
|
+
output += percentEncodeNonAscii(code2);
|
|
403772
|
+
} else if (code2 <= 56319 && i2 + 1 < input.length) {
|
|
403543
403773
|
const low = input.charCodeAt(i2 + 1);
|
|
403544
403774
|
if (low >= 56320 && low <= 57343) {
|
|
403545
|
-
output += percentEncodeNonAscii(65536 + (
|
|
403775
|
+
output += percentEncodeNonAscii(65536 + (code2 - 55296 << 10) + (low - 56320));
|
|
403546
403776
|
i2++;
|
|
403547
403777
|
} else {
|
|
403548
403778
|
output += percentEncodeNonAscii(65533);
|
|
@@ -406291,8 +406521,8 @@ var require_format2 = __commonJS((exports) => {
|
|
|
406291
406521
|
}
|
|
406292
406522
|
}
|
|
406293
406523
|
function getFormat(fmtDef) {
|
|
406294
|
-
const
|
|
406295
|
-
const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
|
|
406524
|
+
const code2 = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : undefined;
|
|
406525
|
+
const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code: code2 });
|
|
406296
406526
|
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
|
|
406297
406527
|
return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
|
|
406298
406528
|
}
|
|
@@ -406902,9 +407132,9 @@ var require_code3 = __commonJS((exports) => {
|
|
|
406902
407132
|
exports.Name = Name;
|
|
406903
407133
|
|
|
406904
407134
|
class _Code extends _CodeOrName {
|
|
406905
|
-
constructor(
|
|
407135
|
+
constructor(code2) {
|
|
406906
407136
|
super();
|
|
406907
|
-
this._items = typeof
|
|
407137
|
+
this._items = typeof code2 === "string" ? [code2] : code2;
|
|
406908
407138
|
}
|
|
406909
407139
|
toString() {
|
|
406910
407140
|
return this.str;
|
|
@@ -406931,13 +407161,13 @@ var require_code3 = __commonJS((exports) => {
|
|
|
406931
407161
|
exports._Code = _Code;
|
|
406932
407162
|
exports.nil = new _Code("");
|
|
406933
407163
|
function _3(strs, ...args) {
|
|
406934
|
-
const
|
|
407164
|
+
const code2 = [strs[0]];
|
|
406935
407165
|
let i2 = 0;
|
|
406936
407166
|
while (i2 < args.length) {
|
|
406937
|
-
addCodeArg(
|
|
406938
|
-
|
|
407167
|
+
addCodeArg(code2, args[i2]);
|
|
407168
|
+
code2.push(strs[++i2]);
|
|
406939
407169
|
}
|
|
406940
|
-
return new _Code(
|
|
407170
|
+
return new _Code(code2);
|
|
406941
407171
|
}
|
|
406942
407172
|
exports._ = _3;
|
|
406943
407173
|
var plus = new _Code("+");
|
|
@@ -406953,13 +407183,13 @@ var require_code3 = __commonJS((exports) => {
|
|
|
406953
407183
|
return new _Code(expr);
|
|
406954
407184
|
}
|
|
406955
407185
|
exports.str = str2;
|
|
406956
|
-
function addCodeArg(
|
|
407186
|
+
function addCodeArg(code2, arg) {
|
|
406957
407187
|
if (arg instanceof _Code)
|
|
406958
|
-
|
|
407188
|
+
code2.push(...arg._items);
|
|
406959
407189
|
else if (arg instanceof Name)
|
|
406960
|
-
|
|
407190
|
+
code2.push(arg);
|
|
406961
407191
|
else
|
|
406962
|
-
|
|
407192
|
+
code2.push(interpolate(arg));
|
|
406963
407193
|
}
|
|
406964
407194
|
exports.addCodeArg = addCodeArg;
|
|
406965
407195
|
function optimize(expr) {
|
|
@@ -407144,7 +407374,7 @@ var require_scope2 = __commonJS((exports) => {
|
|
|
407144
407374
|
}, usedValues, getCode);
|
|
407145
407375
|
}
|
|
407146
407376
|
_reduceValues(values, valueCode, usedValues = {}, getCode) {
|
|
407147
|
-
let
|
|
407377
|
+
let code2 = code_1.nil;
|
|
407148
407378
|
for (const prefix in values) {
|
|
407149
407379
|
const vs2 = values[prefix];
|
|
407150
407380
|
if (!vs2)
|
|
@@ -407157,16 +407387,16 @@ var require_scope2 = __commonJS((exports) => {
|
|
|
407157
407387
|
let c3 = valueCode(name);
|
|
407158
407388
|
if (c3) {
|
|
407159
407389
|
const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
|
|
407160
|
-
|
|
407390
|
+
code2 = (0, code_1._)`${code2}${def} ${name} = ${c3};${this.opts._n}`;
|
|
407161
407391
|
} else if (c3 = getCode === null || getCode === undefined ? undefined : getCode(name)) {
|
|
407162
|
-
|
|
407392
|
+
code2 = (0, code_1._)`${code2}${c3}${this.opts._n}`;
|
|
407163
407393
|
} else {
|
|
407164
407394
|
throw new ValueError(name);
|
|
407165
407395
|
}
|
|
407166
407396
|
nameSet.set(name, UsedValueState.Completed);
|
|
407167
407397
|
});
|
|
407168
407398
|
}
|
|
407169
|
-
return
|
|
407399
|
+
return code2;
|
|
407170
407400
|
}
|
|
407171
407401
|
}
|
|
407172
407402
|
exports.ValueScope = ValueScope;
|
|
@@ -407331,9 +407561,9 @@ var require_codegen3 = __commonJS((exports) => {
|
|
|
407331
407561
|
}
|
|
407332
407562
|
|
|
407333
407563
|
class AnyCode extends Node {
|
|
407334
|
-
constructor(
|
|
407564
|
+
constructor(code2) {
|
|
407335
407565
|
super();
|
|
407336
|
-
this.code =
|
|
407566
|
+
this.code = code2;
|
|
407337
407567
|
}
|
|
407338
407568
|
render({ _n: _n2 }) {
|
|
407339
407569
|
return `${this.code};` + _n2;
|
|
@@ -407356,7 +407586,7 @@ var require_codegen3 = __commonJS((exports) => {
|
|
|
407356
407586
|
this.nodes = nodes;
|
|
407357
407587
|
}
|
|
407358
407588
|
render(opts) {
|
|
407359
|
-
return this.nodes.reduce((
|
|
407589
|
+
return this.nodes.reduce((code2, n) => code2 + n.render(opts), "");
|
|
407360
407590
|
}
|
|
407361
407591
|
optimizeNodes() {
|
|
407362
407592
|
const { nodes } = this;
|
|
@@ -407408,10 +407638,10 @@ var require_codegen3 = __commonJS((exports) => {
|
|
|
407408
407638
|
this.condition = condition;
|
|
407409
407639
|
}
|
|
407410
407640
|
render(opts) {
|
|
407411
|
-
let
|
|
407641
|
+
let code2 = `if(${this.condition})` + super.render(opts);
|
|
407412
407642
|
if (this.else)
|
|
407413
|
-
|
|
407414
|
-
return
|
|
407643
|
+
code2 += "else " + this.else.render(opts);
|
|
407644
|
+
return code2;
|
|
407415
407645
|
}
|
|
407416
407646
|
optimizeNodes() {
|
|
407417
407647
|
super.optimizeNodes();
|
|
@@ -407539,12 +407769,12 @@ var require_codegen3 = __commonJS((exports) => {
|
|
|
407539
407769
|
|
|
407540
407770
|
class Try extends BlockNode {
|
|
407541
407771
|
render(opts) {
|
|
407542
|
-
let
|
|
407772
|
+
let code2 = "try" + super.render(opts);
|
|
407543
407773
|
if (this.catch)
|
|
407544
|
-
|
|
407774
|
+
code2 += this.catch.render(opts);
|
|
407545
407775
|
if (this.finally)
|
|
407546
|
-
|
|
407547
|
-
return
|
|
407776
|
+
code2 += this.finally.render(opts);
|
|
407777
|
+
return code2;
|
|
407548
407778
|
}
|
|
407549
407779
|
optimizeNodes() {
|
|
407550
407780
|
var _a, _b;
|
|
@@ -407653,18 +407883,18 @@ var require_codegen3 = __commonJS((exports) => {
|
|
|
407653
407883
|
return this;
|
|
407654
407884
|
}
|
|
407655
407885
|
object(...keyValues) {
|
|
407656
|
-
const
|
|
407886
|
+
const code2 = ["{"];
|
|
407657
407887
|
for (const [key2, value] of keyValues) {
|
|
407658
|
-
if (
|
|
407659
|
-
|
|
407660
|
-
|
|
407888
|
+
if (code2.length > 1)
|
|
407889
|
+
code2.push(",");
|
|
407890
|
+
code2.push(key2);
|
|
407661
407891
|
if (key2 !== value || this.opts.es5) {
|
|
407662
|
-
|
|
407663
|
-
(0, code_1.addCodeArg)(
|
|
407892
|
+
code2.push(":");
|
|
407893
|
+
(0, code_1.addCodeArg)(code2, value);
|
|
407664
407894
|
}
|
|
407665
407895
|
}
|
|
407666
|
-
|
|
407667
|
-
return new code_1._Code(
|
|
407896
|
+
code2.push("}");
|
|
407897
|
+
return new code_1._Code(code2);
|
|
407668
407898
|
}
|
|
407669
407899
|
if(condition, thenBody, elseBody) {
|
|
407670
407900
|
this._blockNode(new If(condition));
|
|
@@ -411924,8 +412154,8 @@ var require_format4 = __commonJS((exports) => {
|
|
|
411924
412154
|
}
|
|
411925
412155
|
}
|
|
411926
412156
|
function getFormat(fmtDef) {
|
|
411927
|
-
const
|
|
411928
|
-
const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
|
|
412157
|
+
const code2 = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : undefined;
|
|
412158
|
+
const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code: code2 });
|
|
411929
412159
|
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
|
|
411930
412160
|
return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
|
|
411931
412161
|
}
|
|
@@ -413765,9 +413995,9 @@ function formatDiagnosticsText(diagnostics) {
|
|
|
413765
413995
|
const shown = errors4.length > 0 ? errors4 : diagnostics;
|
|
413766
413996
|
const lines = shown.map((d2) => {
|
|
413767
413997
|
const at2 = d2.line !== undefined ? ` (line ${d2.line}, character ${d2.character ?? 0})` : "";
|
|
413768
|
-
const
|
|
413998
|
+
const code2 = d2.code ? ` [${d2.code}]` : "";
|
|
413769
413999
|
const model = d2.model ? `${d2.model}: ` : "";
|
|
413770
|
-
return `- ${model}${d2.message}${at2}${
|
|
414000
|
+
return `- ${model}${d2.message}${at2}${code2}`;
|
|
413771
414001
|
});
|
|
413772
414002
|
const noun = shown.length === 1 ? "error" : "errors";
|
|
413773
414003
|
return `Compile failed with ${shown.length} ${noun} (positions are 0-based):
|
|
@@ -419180,11 +419410,11 @@ var init_dist6 = __esm(() => {
|
|
|
419180
419410
|
"draft-8"
|
|
419181
419411
|
];
|
|
419182
419412
|
ValidationError = class extends Error {
|
|
419183
|
-
constructor(
|
|
419184
|
-
const url3 = `https://express-rate-limit.github.io/${
|
|
419413
|
+
constructor(code2, message) {
|
|
419414
|
+
const url3 = `https://express-rate-limit.github.io/${code2}/`;
|
|
419185
419415
|
super(`${message} See ${url3} for more information.`);
|
|
419186
419416
|
this.name = this.constructor.name;
|
|
419187
|
-
this.code =
|
|
419417
|
+
this.code = code2;
|
|
419188
419418
|
this.help = url3;
|
|
419189
419419
|
}
|
|
419190
419420
|
};
|
|
@@ -419820,34 +420050,11 @@ function writeToStderr(text) {
|
|
|
419820
420050
|
}
|
|
419821
420051
|
|
|
419822
420052
|
// src/cli_args.ts
|
|
420053
|
+
init_reference();
|
|
419823
420054
|
function printHelpIfAsked(args) {
|
|
419824
420055
|
if (!args.some((arg) => arg === "--help" || arg === "-h"))
|
|
419825
420056
|
return;
|
|
419826
|
-
console.log(
|
|
419827
|
-
console.log("");
|
|
419828
|
-
console.log("Usage: malloy-publisher [options]");
|
|
419829
|
-
console.log("");
|
|
419830
|
-
console.log("Options:");
|
|
419831
|
-
console.log(" --port <number> Port to run the server on (default: 4000)");
|
|
419832
|
-
console.log(" --host <string> Host to bind the REST server to, and the MCP server unless --mcp_host is given (default: 0.0.0.0)");
|
|
419833
|
-
console.log(" --mcp_host <string> Host to bind the MCP server to (default: 127.0.0.1, or --host when that is set)");
|
|
419834
|
-
console.log(" --server_root <path> Root directory to serve files from (default: .)");
|
|
419835
|
-
console.log(" --config <path> Path to publisher.config.json (default: <server_root>/publisher.config.json; falls back to bundled DuckDB-only sample config if missing)");
|
|
419836
|
-
console.log(" --mcp_port <number> Port for MCP server (default: 4040)");
|
|
419837
|
-
console.log(" --admin_port <number> Port for the admin API, an orchestrator's catalog operations (default: off)");
|
|
419838
|
-
console.log(" --admin_host <string> Host to bind the admin API to (default: 127.0.0.1; not moved by --host)");
|
|
419839
|
-
console.log(" --[no-]serving-api-enabled Run the main API and MCP (default: on; off runs only the admin API)");
|
|
419840
|
-
console.log(" --[no-]admin-api-enabled Allow the admin API (default: on; off refuses an admin setting)");
|
|
419841
|
-
console.log(" --shutdown_drain_duration_seconds <number> Time in seconds to keep service in draining state before closing servers (default: 0)");
|
|
419842
|
-
console.log(" --shutdown_graceful_close_timeout_seconds <number> Time in seconds to wait after closing servers before exit (default: 0)");
|
|
419843
|
-
console.log(" --init Wipe persisted storage and re-sync it from the config (default: false)");
|
|
419844
|
-
console.log(" --no-mcp-config Do not write .mcp.json into the working directory (default: it is written, so an agent opened here finds this server; skipped when the directory already has one, is your home directory or the filesystem root, is inside a git working tree, or the MCP port bound is not the one requested)");
|
|
419845
|
-
console.log(" --watch-env <name> Enable dev-mode watch for the named environment.");
|
|
419846
|
-
console.log(" Mounts local-dir packages in-place (symlink, not");
|
|
419847
|
-
console.log(" copy) so source-edit live reload works. A comma-");
|
|
419848
|
-
console.log(" separated PUBLISHER_WATCH mounts all listed envs in");
|
|
419849
|
-
console.log(" place, but only the first one auto-reloads.");
|
|
419850
|
-
console.log(" --help, -h Show this help message");
|
|
420057
|
+
console.log(helpText());
|
|
419851
420058
|
process.exit(0);
|
|
419852
420059
|
}
|
|
419853
420060
|
|
|
@@ -419874,6 +420081,8 @@ var { logger: logger2 } = await Promise.resolve().then(() => (init_logger(), exp
|
|
|
419874
420081
|
for (const warning of loaded2.warnings) {
|
|
419875
420082
|
logger2.warn(warning.message);
|
|
419876
420083
|
}
|
|
420084
|
+
var { settingsLine: settingsLine2 } = await Promise.resolve().then(() => (init_reference(), exports_reference));
|
|
420085
|
+
logger2.info(settingsLine2(loaded2));
|
|
419877
420086
|
var { getServerApiSettings: getServerApiSettings2 } = await Promise.resolve().then(() => (init_config(), exports_config));
|
|
419878
420087
|
var { assertServerApis: assertServerApis2 } = await Promise.resolve().then(() => (init_server_apis(), exports_server_apis));
|
|
419879
420088
|
var apis = getServerApiSettings2();
|