@gadicc/loom 1.33.1 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +108 -41
  2. package/esm/src/apiKeys/authorize.d.ts.map +1 -1
  3. package/esm/src/apiKeys/authorize.js +71 -0
  4. package/esm/src/apiKeys/betterAuth.d.ts +123 -0
  5. package/esm/src/apiKeys/betterAuth.d.ts.map +1 -0
  6. package/esm/src/apiKeys/betterAuth.js +164 -0
  7. package/esm/src/apiKeys/credentials.d.ts +37 -2
  8. package/esm/src/apiKeys/credentials.d.ts.map +1 -1
  9. package/esm/src/apiKeys/credentials.js +69 -8
  10. package/esm/src/apiKeys/lifecycle.d.ts +41 -0
  11. package/esm/src/apiKeys/lifecycle.d.ts.map +1 -0
  12. package/esm/src/apiKeys/lifecycle.js +6 -0
  13. package/esm/src/apiKeys/limits.d.ts +132 -0
  14. package/esm/src/apiKeys/limits.d.ts.map +1 -0
  15. package/esm/src/apiKeys/limits.js +246 -0
  16. package/esm/src/apiKeys/mod.d.ts +4 -0
  17. package/esm/src/apiKeys/mod.d.ts.map +1 -1
  18. package/esm/src/apiKeys/mod.js +4 -0
  19. package/esm/src/apiKeys/permissions.d.ts +56 -0
  20. package/esm/src/apiKeys/permissions.d.ts.map +1 -0
  21. package/esm/src/apiKeys/permissions.js +128 -0
  22. package/esm/src/apiKeys/policy.d.ts +3 -1
  23. package/esm/src/apiKeys/policy.d.ts.map +1 -1
  24. package/esm/src/apiKeys/policy.js +3 -1
  25. package/esm/src/apiKeys/types.d.ts +68 -1
  26. package/esm/src/apiKeys/types.d.ts.map +1 -1
  27. package/esm/src/cli/localDb.d.ts +28 -0
  28. package/esm/src/cli/localDb.d.ts.map +1 -0
  29. package/esm/src/cli/localDb.js +366 -0
  30. package/esm/src/cli/localDevLock.d.ts +97 -0
  31. package/esm/src/cli/localDevLock.d.ts.map +1 -0
  32. package/esm/src/cli/localDevLock.js +312 -0
  33. package/esm/src/cli/localDevPackage.d.ts +172 -0
  34. package/esm/src/cli/localDevPackage.d.ts.map +1 -0
  35. package/esm/src/cli/localDevPackage.js +617 -0
  36. package/esm/src/cli/migrationEnv.d.ts +19 -0
  37. package/esm/src/cli/migrationEnv.d.ts.map +1 -1
  38. package/esm/src/cli/migrationEnv.js +44 -1
  39. package/esm/src/cli/mod.d.ts +69 -4
  40. package/esm/src/cli/mod.d.ts.map +1 -1
  41. package/esm/src/cli/mod.js +2822 -419
  42. package/esm/src/cli/projectTooling.d.ts +19 -1
  43. package/esm/src/cli/projectTooling.d.ts.map +1 -1
  44. package/esm/src/cli/projectTooling.js +142 -12
  45. package/esm/src/mui/apiKeys.d.ts +123 -17
  46. package/esm/src/mui/apiKeys.d.ts.map +1 -1
  47. package/esm/src/mui/apiKeys.js +219 -78
  48. package/esm/src/mui/apiKeysView.d.ts +145 -0
  49. package/esm/src/mui/apiKeysView.d.ts.map +1 -1
  50. package/esm/src/mui/apiKeysView.js +278 -0
  51. package/esm/src/next/apiKeys/mod.d.ts +8 -1
  52. package/esm/src/next/apiKeys/mod.d.ts.map +1 -1
  53. package/esm/src/next/apiKeys/mod.js +5 -2
  54. package/package.json +2 -6
  55. package/script/src/apiKeys/authorize.d.ts.map +1 -1
  56. package/script/src/apiKeys/authorize.js +71 -0
  57. package/script/src/apiKeys/betterAuth.d.ts +123 -0
  58. package/script/src/apiKeys/betterAuth.d.ts.map +1 -0
  59. package/script/src/apiKeys/betterAuth.js +169 -0
  60. package/script/src/apiKeys/credentials.d.ts +37 -2
  61. package/script/src/apiKeys/credentials.d.ts.map +1 -1
  62. package/script/src/apiKeys/credentials.js +71 -8
  63. package/script/src/apiKeys/lifecycle.d.ts +41 -0
  64. package/script/src/apiKeys/lifecycle.d.ts.map +1 -0
  65. package/script/src/apiKeys/lifecycle.js +7 -0
  66. package/script/src/apiKeys/limits.d.ts +132 -0
  67. package/script/src/apiKeys/limits.d.ts.map +1 -0
  68. package/script/src/apiKeys/limits.js +254 -0
  69. package/script/src/apiKeys/mod.d.ts +4 -0
  70. package/script/src/apiKeys/mod.d.ts.map +1 -1
  71. package/script/src/apiKeys/mod.js +4 -0
  72. package/script/src/apiKeys/permissions.d.ts +56 -0
  73. package/script/src/apiKeys/permissions.d.ts.map +1 -0
  74. package/script/src/apiKeys/permissions.js +136 -0
  75. package/script/src/apiKeys/policy.d.ts +3 -1
  76. package/script/src/apiKeys/policy.d.ts.map +1 -1
  77. package/script/src/apiKeys/policy.js +3 -1
  78. package/script/src/apiKeys/types.d.ts +68 -1
  79. package/script/src/apiKeys/types.d.ts.map +1 -1
  80. package/script/src/cli/localDb.d.ts +28 -0
  81. package/script/src/cli/localDb.d.ts.map +1 -0
  82. package/script/src/cli/localDb.js +370 -0
  83. package/script/src/cli/localDevLock.d.ts +97 -0
  84. package/script/src/cli/localDevLock.d.ts.map +1 -0
  85. package/script/src/cli/localDevLock.js +320 -0
  86. package/script/src/cli/localDevPackage.d.ts +172 -0
  87. package/script/src/cli/localDevPackage.d.ts.map +1 -0
  88. package/script/src/cli/localDevPackage.js +635 -0
  89. package/script/src/cli/migrationEnv.d.ts +19 -0
  90. package/script/src/cli/migrationEnv.d.ts.map +1 -1
  91. package/script/src/cli/migrationEnv.js +48 -1
  92. package/script/src/cli/mod.d.ts +69 -4
  93. package/script/src/cli/mod.d.ts.map +1 -1
  94. package/script/src/cli/mod.js +2823 -419
  95. package/script/src/cli/projectTooling.d.ts +19 -1
  96. package/script/src/cli/projectTooling.d.ts.map +1 -1
  97. package/script/src/cli/projectTooling.js +176 -12
  98. package/script/src/mui/apiKeys.d.ts +123 -17
  99. package/script/src/mui/apiKeys.d.ts.map +1 -1
  100. package/script/src/mui/apiKeys.js +220 -77
  101. package/script/src/mui/apiKeysView.d.ts +145 -0
  102. package/script/src/mui/apiKeysView.d.ts.map +1 -1
  103. package/script/src/mui/apiKeysView.js +291 -0
  104. package/script/src/next/apiKeys/mod.d.ts +8 -1
  105. package/script/src/next/apiKeys/mod.d.ts.map +1 -1
  106. package/script/src/next/apiKeys/mod.js +5 -2
  107. package/skills/loom/SKILL.md +116 -18
  108. package/skills/loom-api-keys/SKILL.md +101 -7
  109. package/skills/loom-auth/SKILL.md +9 -0
  110. package/skills/loom-db/SKILL.md +33 -1
@@ -27,6 +27,8 @@ export type ProjectPackageJson = {
27
27
  devDependencies?: Record<string, string>;
28
28
  name?: string;
29
29
  packageManager?: string;
30
+ pnpm?: Record<string, unknown>;
31
+ resolutions?: Record<string, unknown>;
30
32
  scripts?: Record<string, string>;
31
33
  version?: string;
32
34
  };
@@ -87,10 +89,26 @@ export declare function mutateProjectDependencies(cwd: string, tooling: ProjectT
87
89
  config: TaskConfigPath;
88
90
  removedKeys: string[];
89
91
  }>;
92
+ /** A package.json map that pnpm 10 and older read as dependency overrides. */
93
+ export type PackageJsonOverrideField = "pnpm.overrides" | "resolutions";
94
+ /**
95
+ * Sets, replaces, or (with an undefined value) removes one entry of a
96
+ * package.json override map with a minimal text edit that keeps the file's
97
+ * formatting. A missing map is created. Removing a map's last entry leaves
98
+ * the map in place unless `removeEmptyMap` says the caller created it.
99
+ */
100
+ export declare function mutatePackageJsonOverride(cwd: string, field: PackageJsonOverrideField, name: string, value: string | undefined, options?: {
101
+ /** Remove the map too when removing its last entry. */
102
+ removeEmptyMap?: boolean;
103
+ /** Remove an emptied `pnpm` object too (with `pnpm.overrides`). */
104
+ removeEmptyPnpm?: boolean;
105
+ }): Promise<{
106
+ changed: boolean;
107
+ }>;
90
108
  /** Adds or removes local dependency links in a Deno config. */
91
109
  export declare function mutateDenoLinks(cwd: string, config: "deno.json" | "deno.jsonc", mutation: {
92
110
  add?: string;
93
- remove?: string;
111
+ remove?: string | readonly string[];
94
112
  }): Promise<{
95
113
  changed: boolean;
96
114
  links: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"projectTooling.d.ts","sourceRoot":"","sources":["../../../src/src/cli/projectTooling.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,cAAc,GA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AAC5D,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,EAChC,OAAO,EAAE,iBAAiB;;;;;GA+B3B;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM;;;GAiCrB;AAED,gFAAgF;AAChF,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM;;;GAqBjB;AAaD,0EAA0E;AAC1E,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,cAAc,CAAC,OAAO,CAAC,GACrC,OAAO,CAAC,YAAY,EAAE,CAAC,CAoCzB"}
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.parseJsonc = parseJsonc;
4
37
  exports.detectProjectTooling = detectProjectTooling;
@@ -6,6 +39,7 @@ exports.readTaskStore = readTaskStore;
6
39
  exports.denoConfigAsPackageJson = denoConfigAsPackageJson;
7
40
  exports.readProjectPackageMetadata = readProjectPackageMetadata;
8
41
  exports.mutateProjectDependencies = mutateProjectDependencies;
42
+ exports.mutatePackageJsonOverride = mutatePackageJsonOverride;
9
43
  exports.mutateDenoLinks = mutateDenoLinks;
10
44
  exports.readDenoLinks = readDenoLinks;
11
45
  exports.getTaskCommand = getTaskCommand;
@@ -19,14 +53,16 @@ exports.ensureTaskPrerequisite = ensureTaskPrerequisite;
19
53
  exports.ensureTaskFollowup = ensureTaskFollowup;
20
54
  exports.findTaskConflicts = findTaskConflicts;
21
55
  const promises_1 = require("node:fs/promises");
22
- const node_module_1 = require("node:module");
23
56
  const node_path_1 = require("node:path");
24
- const jsoncRequire = (0, node_module_1.createRequire)(globalThis[Symbol.for("import-meta-ponyfill-commonjs")](require, module).url);
25
- let cachedJsoncParser;
26
- function getJsoncParser() {
27
- cachedJsoncParser ??= jsoncRequire("jsonc-parser");
28
- return cachedJsoncParser;
29
- }
57
+ const jsoncParserNamespace = __importStar(require("jsonc-parser"));
58
+ // A static import, not a lazy createRequire(), so jsonc-parser is part of
59
+ // every module graph that reaches these exported helpers. It is UMD without
60
+ // an `exports` map: Node's ESM loader exposes its named exports only when
61
+ // cjs-module-lexer recognises them, so fall back to the CommonJS object that
62
+ // it always provides as `default`.
63
+ const jsoncParser = typeof jsoncParserNamespace.modify === "function"
64
+ ? jsoncParserNamespace
65
+ : jsoncParserNamespace.default;
30
66
  async function readTextIfExists(path) {
31
67
  try {
32
68
  return await (0, promises_1.readFile)(path, "utf8");
@@ -39,7 +75,7 @@ async function readTextIfExists(path) {
39
75
  }
40
76
  /** Parses Deno JSON/JSONC while reporting every syntax error. */
41
77
  function parseJsonc(text, filename) {
42
- const { parse, printParseErrorCode } = getJsoncParser();
78
+ const { parse, printParseErrorCode } = jsoncParser;
43
79
  const errors = [];
44
80
  const value = parse(text, errors, {
45
81
  allowEmptyContent: false,
@@ -73,7 +109,7 @@ function formattingOptions(text) {
73
109
  };
74
110
  }
75
111
  function updateJsonPath(text, path, value) {
76
- const { applyEdits, modify } = getJsoncParser();
112
+ const { applyEdits, modify } = jsoncParser;
77
113
  return applyEdits(text, modify(text, path, value, { formattingOptions: formattingOptions(text) }));
78
114
  }
79
115
  function hasOwn(value, key) {
@@ -390,6 +426,133 @@ async function mutateProjectDependencies(cwd, tooling, mutation) {
390
426
  removedKeys: [...new Set(removedKeys)],
391
427
  };
392
428
  }
429
+ function isPlainObject(value) {
430
+ return value !== null && typeof value === "object" && !Array.isArray(value);
431
+ }
432
+ function getJsonPath(value, path) {
433
+ let current = value;
434
+ for (const key of path) {
435
+ current = isPlainObject(current) ? current[key] : undefined;
436
+ }
437
+ return current;
438
+ }
439
+ /**
440
+ * Sets, replaces, or (with an undefined value) removes one entry of a
441
+ * package.json override map with a minimal text edit that keeps the file's
442
+ * formatting. A missing map is created. Removing a map's last entry leaves
443
+ * the map in place unless `removeEmptyMap` says the caller created it.
444
+ */
445
+ async function mutatePackageJsonOverride(cwd, field, name, value, options = {}) {
446
+ const path = (0, node_path_1.join)(cwd, "package.json");
447
+ const original = await readTextIfExists(path);
448
+ if (original === null)
449
+ throw new Error("Missing package.json");
450
+ const config = parseStrictJson(original, "package.json");
451
+ const mapPath = field === "resolutions" ? ["resolutions"] : [
452
+ "pnpm",
453
+ "overrides",
454
+ ];
455
+ if (getJsonPath(config, [...mapPath, name]) === value) {
456
+ return { changed: false };
457
+ }
458
+ let editPath = [...mapPath, name];
459
+ let editValue = value;
460
+ const map = getJsonPath(config, mapPath);
461
+ if (value === undefined) {
462
+ if (options.removeEmptyMap && isPlainObject(map) &&
463
+ Object.keys(map).length === 1) {
464
+ editPath = mapPath;
465
+ if (options.removeEmptyPnpm && field === "pnpm.overrides" &&
466
+ isPlainObject(config.pnpm) && Object.keys(config.pnpm).length === 1) {
467
+ editPath = ["pnpm"];
468
+ }
469
+ }
470
+ }
471
+ else if (map === undefined) {
472
+ if (field === "pnpm.overrides" && config.pnpm === undefined) {
473
+ editPath = ["pnpm"];
474
+ editValue = { overrides: { [name]: value } };
475
+ }
476
+ else {
477
+ editPath = mapPath;
478
+ editValue = { [name]: value };
479
+ }
480
+ }
481
+ const text = editSingleLineObjectEntry(original, editPath.slice(0, -1), editPath[editPath.length - 1], editValue) ?? updateJsonPath(original, editPath, editValue);
482
+ if (text !== original)
483
+ await (0, promises_1.writeFile)(path, text, "utf8");
484
+ return { changed: text !== original };
485
+ }
486
+ /**
487
+ * Appends or removes one entry of an object written on a single line without
488
+ * reformatting it, so a compact map such as `{ "a": "1" }` round-trips byte
489
+ * for byte (jsonc `modify` would expand it). Returns null when the object is
490
+ * missing, spans lines, or the edit is not a plain append or removal.
491
+ */
492
+ function editSingleLineObjectEntry(text, objectPath, name, value) {
493
+ const { findNodeAtLocation, parseTree } = jsoncParser;
494
+ const tree = parseTree(text);
495
+ const object = tree
496
+ ? objectPath.length ? findNodeAtLocation(tree, objectPath) : tree
497
+ : undefined;
498
+ const properties = object?.type === "object" ? object.children ?? [] : [];
499
+ const objectText = object
500
+ ? text.slice(object.offset, object.offset + object.length)
501
+ : "";
502
+ if (!object || object.type !== "object" || objectText.includes("\n")) {
503
+ return null;
504
+ }
505
+ const end = (node) => node.offset + node.length;
506
+ const index = properties.findIndex((property) => property.children?.[0]?.value === name);
507
+ let edited;
508
+ if (value === undefined) {
509
+ if (index === -1)
510
+ return null;
511
+ const property = properties[index];
512
+ // Removing the only entry of `{"a":1}` gives back `{}`.
513
+ const start = properties.length === 1
514
+ ? property.offset
515
+ : index > 0
516
+ ? end(properties[index - 1])
517
+ : property.offset;
518
+ const stop = properties.length === 1 || index > 0
519
+ ? end(property)
520
+ : properties[index + 1].offset;
521
+ edited = text.slice(0, start) + text.slice(stop);
522
+ }
523
+ else if (properties.length === 0) {
524
+ if (objectText !== "{}")
525
+ return null;
526
+ edited = `${text.slice(0, object.offset + 1)}${JSON.stringify(name)}:${JSON.stringify(value)}${text.slice(object.offset + 1)}`;
527
+ }
528
+ else {
529
+ if (index !== -1)
530
+ return null;
531
+ const last = properties[properties.length - 1];
532
+ const [lastKey, lastValue] = last.children ?? [];
533
+ if (!lastKey || !lastValue)
534
+ return null;
535
+ const colon = text.slice(end(lastKey), lastValue.offset);
536
+ const separator = properties.length > 1
537
+ ? text.slice(end(properties[properties.length - 2]), last.offset)
538
+ : /^\{\s/.test(text.slice(object.offset))
539
+ ? ", "
540
+ : ",";
541
+ edited = `${text.slice(0, end(last))}${separator}${JSON.stringify(name)}${colon}${JSON.stringify(value)}${text.slice(end(last))}`;
542
+ }
543
+ // Keep the textual edit only when it parses to exactly the intended value.
544
+ let parsed;
545
+ try {
546
+ parsed = JSON.parse(edited);
547
+ }
548
+ catch {
549
+ return null;
550
+ }
551
+ return JSON.stringify(getJsonPath(parsed, [...objectPath, name])) ===
552
+ JSON.stringify(value)
553
+ ? edited
554
+ : null;
555
+ }
393
556
  /** Adds or removes local dependency links in a Deno config. */
394
557
  async function mutateDenoLinks(cwd, config, mutation) {
395
558
  const path = (0, node_path_1.join)(cwd, config);
@@ -398,9 +561,10 @@ async function mutateDenoLinks(cwd, config, mutation) {
398
561
  throw new Error(`Missing Deno config: ${config}`);
399
562
  const denoConfig = parseJsonc(original, config);
400
563
  let links = [...(denoConfig.links ?? [])];
401
- if (mutation.remove) {
402
- links = links.filter((link) => link !== mutation.remove);
403
- }
564
+ const remove = typeof mutation.remove === "string"
565
+ ? [mutation.remove]
566
+ : mutation.remove ?? [];
567
+ links = links.filter((link) => !remove.includes(link));
404
568
  if (mutation.add && !links.includes(mutation.add))
405
569
  links.push(mutation.add);
406
570
  const text = JSON.stringify(links) === JSON.stringify(denoConfig.links ?? [])
@@ -1,44 +1,126 @@
1
1
  import "../../_dnt.polyfills.js";
2
+ /**
3
+ * MUI components for API-key management.
4
+ *
5
+ * Requires `@mui/material` 6 or newer (TextField `slotProps`), although the
6
+ * package's optional `@mui/material` peer stays `>=5` for `mui/mail` and
7
+ * `mui/confirm`. The dialogs track pending requests with React 19 async
8
+ * transitions; on React 18 they work but do not disable while pending.
9
+ *
10
+ * @module
11
+ */
12
+ import { type AlertProps } from "@mui/material/Alert";
2
13
  import { type ReactNode } from "react";
3
- import { type ApiKeyAuditRow, type ApiKeyRow, type ApiKeyScopeDefinition } from "./apiKeysView.js";
14
+ import type { ApiKeyCredentialOptions } from "../apiKeys/types.js";
15
+ import type { ApiKeyCreateActionResult, ApiKeyCreateInput, ApiKeyCreateResult, ApiKeyMutationResult } from "../apiKeys/lifecycle.js";
16
+ import type { ApiKeyLimits } from "../apiKeys/limits.js";
17
+ import { type ApiKeyAuditRow, type ApiKeyRow, type ApiKeyScopeDefinition, type ApiKeyThrownErrorMessages } from "./apiKeysView.js";
4
18
  export * from "./apiKeysView.js";
5
- export interface ApiKeyCreateInput {
6
- expiresAt: string | null;
7
- name: string;
8
- scopeIds: string[];
9
- }
10
- export interface ApiKeyCreateResult {
11
- key: string;
12
- keyStart?: string;
13
- name: string;
14
- }
15
19
  export interface ApiKeyTableColumn {
16
20
  header: ReactNode;
17
21
  id: string;
18
22
  render: (row: ApiKeyRow) => ReactNode;
19
23
  }
20
24
  export interface ApiKeyCreateDialogProps {
25
+ /** Offer "Never" as an expiry. Defaults to `true`. */
26
+ allowNoExpiry?: boolean;
21
27
  error?: string | null;
28
+ /**
29
+ * Preset lifetimes in days. Presets outside `limits` are hidden. Defaults
30
+ * to `[7, 30]`.
31
+ */
32
+ expiryPresetDays?: readonly number[];
33
+ /**
34
+ * Name and expiry bounds, checked before `onCreate` with the same messages
35
+ * as server-side validation. Pass the limits given to the plugin; omitted
36
+ * bounds are not checked here.
37
+ */
38
+ limits?: Partial<ApiKeyLimits>;
22
39
  onClose: () => void;
23
- onCreate: (input: ApiKeyCreateInput) => Promise<ApiKeyCreateResult>;
40
+ /**
41
+ * Creates the key. Return `{ ok: false, message }` for a user-correctable
42
+ * problem: Next.js masks thrown Server Function messages in production.
43
+ * A thrown error's message is shown unless `thrownErrorMessages` is
44
+ * `"generic"`.
45
+ */
46
+ onCreate: (input: ApiKeyCreateInput) => Promise<ApiKeyCreateResult | ApiKeyCreateActionResult>;
24
47
  onCreated: (result: ApiKeyCreateResult) => void;
25
48
  open: boolean;
26
49
  scopes: ApiKeyScopeDefinition[];
50
+ /**
51
+ * `"show"` (default, the original behaviour) displays a thrown error's
52
+ * message; `"generic"` shows a fixed message instead. Use `"generic"` with
53
+ * result-returning `onCreate` callbacks.
54
+ */
55
+ thrownErrorMessages?: ApiKeyThrownErrorMessages;
27
56
  }
28
57
  export declare function ApiKeyCreateDialog(props: ApiKeyCreateDialogProps): any;
58
+ export interface ApiKeyTransportGuidanceProps {
59
+ /**
60
+ * The same plain options object the authorizer uses, so the copy cannot
61
+ * drift from the transports the app accepts.
62
+ */
63
+ credentialOptions: ApiKeyCredentialOptions;
64
+ sx?: AlertProps["sx"];
65
+ }
66
+ /**
67
+ * Tells key holders how to send a key: the preferred transport (Bearer when
68
+ * enabled), the other accepted ones, and a URL-leakage warning when query
69
+ * credentials are enabled.
70
+ */
71
+ export declare function ApiKeyTransportGuidance(props: ApiKeyTransportGuidanceProps): any;
29
72
  export interface ApiKeySecretDialogProps {
73
+ /**
74
+ * The app's accepted transports. When given, the dialog shows
75
+ * `ApiKeyTransportGuidance` and ignores `queryCredentialsEnabled`.
76
+ */
77
+ credentialOptions?: ApiKeyCredentialOptions;
30
78
  open: boolean;
31
79
  onClose: () => void;
80
+ /**
81
+ * @deprecated Pass `credentialOptions`, so the copy matches the transports
82
+ * the authorizer accepts. Without `credentialOptions`, `true` still shows
83
+ * the original query-parameter warning.
84
+ */
32
85
  queryCredentialsEnabled?: boolean;
33
86
  result: ApiKeyCreateResult | null;
34
87
  }
35
88
  export declare function ApiKeySecretDialog(props: ApiKeySecretDialogProps): any;
89
+ export interface ApiKeyRenameDialogProps {
90
+ /** The key's current name; the field starts with it on every open. */
91
+ currentName: string;
92
+ /** Name bounds, checked with the same messages as server validation. */
93
+ limits?: Partial<ApiKeyLimits>;
94
+ onClose: () => void;
95
+ /**
96
+ * Renames the key to the trimmed, validated name. Return
97
+ * `{ ok: false, message }` for a user-correctable problem; a thrown error
98
+ * shows a generic message because Next.js masks its text in production.
99
+ */
100
+ onRename: (name: string) => Promise<void | ApiKeyMutationResult>;
101
+ open: boolean;
102
+ }
103
+ /**
104
+ * Edits one key name with inline validation. A failed rename keeps the dialog
105
+ * open with the typed value; an unchanged name closes it without a call.
106
+ */
107
+ export declare function ApiKeyRenameDialog(props: ApiKeyRenameDialogProps): any;
36
108
  export interface ApiKeysTableProps {
37
109
  admin?: boolean;
38
110
  extraColumns?: ApiKeyTableColumn[];
111
+ /** Name bounds for the rename dialog. */
112
+ limits?: Partial<ApiKeyLimits>;
39
113
  loading?: boolean;
40
- onRename?: (id: string, name: string) => Promise<void>;
41
- onRevoke?: (id: string) => Promise<void>;
114
+ /**
115
+ * Renames a key. Return `{ ok: false, message }` for a user-correctable
116
+ * problem; thrown errors show a generic message.
117
+ */
118
+ onRename?: (id: string, name: string) => Promise<void | ApiKeyMutationResult>;
119
+ /**
120
+ * Revokes a key after a confirmation prompt. Return `{ ok: false, message }`
121
+ * for a user-correctable problem; thrown errors show a generic message.
122
+ */
123
+ onRevoke?: (id: string) => Promise<void | ApiKeyMutationResult>;
42
124
  rows: ApiKeyRow[];
43
125
  scopes?: ApiKeyScopeDefinition[];
44
126
  }
@@ -51,15 +133,39 @@ export interface ApiKeyAuditTableProps {
51
133
  page: number;
52
134
  rows: ApiKeyAuditRow[];
53
135
  rowsPerPage: number;
136
+ /**
137
+ * Show the Key column. Defaults to whether any row on the current page has
138
+ * a `keyName` or `keyStart` snapshot; pass it when the app maps snapshots,
139
+ * so the column does not appear and disappear between pages.
140
+ */
141
+ showKey?: boolean;
54
142
  }
55
143
  export declare function ApiKeyAuditTable(props: ApiKeyAuditTableProps): any;
56
144
  export interface ApiKeysManagerProps extends Omit<ApiKeysTableProps, "onRevoke" | "onRename"> {
145
+ /** Offer "Never" as an expiry in the create dialog. Defaults to `true`. */
146
+ allowNoExpiry?: boolean;
57
147
  error?: string | null;
58
- onCreate?: (input: ApiKeyCreateInput) => Promise<ApiKeyCreateResult>;
59
- onRename?: (id: string, name: string) => Promise<void>;
60
- onRevoke?: (id: string) => Promise<void>;
148
+ /** Create-dialog expiry presets in days. Defaults to `[7, 30]`. */
149
+ expiryPresetDays?: readonly number[];
150
+ /** See `ApiKeyCreateDialogProps.onCreate`. */
151
+ onCreate?: (input: ApiKeyCreateInput) => Promise<ApiKeyCreateResult | ApiKeyCreateActionResult>;
152
+ /** See `ApiKeysTableProps.onRename`. */
153
+ onRename?: (id: string, name: string) => Promise<void | ApiKeyMutationResult>;
154
+ /** See `ApiKeysTableProps.onRevoke`. */
155
+ onRevoke?: (id: string) => Promise<void | ApiKeyMutationResult>;
156
+ /**
157
+ * The same plain options object the authorizer uses. The secret dialog
158
+ * then derives its transport guidance from it; render
159
+ * `ApiKeyTransportGuidance` elsewhere on the page for the same copy.
160
+ */
161
+ credentialOptions?: ApiKeyCredentialOptions;
162
+ /**
163
+ * @deprecated Pass `credentialOptions` instead; it overrides this prop.
164
+ */
61
165
  queryCredentialsEnabled?: boolean;
62
166
  scopes: ApiKeyScopeDefinition[];
167
+ /** See `ApiKeyCreateDialogProps.thrownErrorMessages`. */
168
+ thrownErrorMessages?: ApiKeyThrownErrorMessages;
63
169
  }
64
170
  export declare function ApiKeysManager(props: ApiKeysManagerProps): any;
65
171
  //# sourceMappingURL=apiKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apiKeys.d.ts","sourceRoot":"","sources":["../../../src/src/mui/apiKeys.tsx"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AA2BjC,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAI3B,MAAM,kBAAkB,CAAC;AAE1B,cAAc,kBAAkB,CAAC;AA2BjC,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,SAAS,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS,CAAC;CACvC;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpE,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,OAiJhE;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE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