@knkcs/importhub-ui 0.5.0 → 0.6.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.
@@ -1,6 +1,26 @@
1
1
  import { JSX } from 'react';
2
2
  import { Schema } from '@knkcs/fieldkit/schema';
3
3
 
4
+ /**
5
+ * An importhub API key of the workspace (importhub.v1.APIKey): an odon API
6
+ * key with scope `importhub:workspace:<W>`, which importhub created with a
7
+ * standing Delegation Grant that ends with it (ADR 0006, amended). Never its
8
+ * secret.
9
+ */
10
+ declare interface ApiKey {
11
+ id: string;
12
+ /** What it is for, as people read it: "Nightly gesetz feed". */
13
+ name: string;
14
+ /** The secret's first characters, for telling keys apart. */
15
+ keyPrefix: string;
16
+ /** The odon user id of who created it, as whom it acts; the host's members name them. */
17
+ owner: string;
18
+ /** When it stops working, as an ISO 8601 timestamp; "" for never. */
19
+ expireTime: string;
20
+ /** When it was created, as an ISO 8601 timestamp. */
21
+ createTime: string;
22
+ }
23
+
4
24
  /** What moving a Mapping's draft to another Blueprint Release would lose. */
5
25
  declare interface BlueprintReleaseCheck {
6
26
  blueprintId: string;
@@ -98,6 +118,21 @@ declare interface Configured<C> {
98
118
  state: ConfigurationState;
99
119
  }
100
120
 
121
+ /** What creating an API key takes. */
122
+ declare interface CreateApiKeyInput {
123
+ /** Not blank, at most API_KEY_NAME_MAX characters. */
124
+ name: string;
125
+ /** When it stops working, as an ISO 8601 timestamp in the future; "" or unset for never. */
126
+ expireTime?: string;
127
+ }
128
+
129
+ /** A key just created, with its secret: the one time importhub returns it. */
130
+ declare interface CreatedApiKey {
131
+ apiKey: ApiKey;
132
+ /** To send as `Authorization: Bearer <secret>`; no later call returns it. */
133
+ secret: string;
134
+ }
135
+
101
136
  /** A Release cut, and for a Mapping the Import Profiles that take it. */
102
137
  declare interface CutReleaseResult {
103
138
  release: ConfigurationReleaseRecord;
@@ -234,6 +269,21 @@ declare interface ImporthubClient {
234
269
  /** Asks a queued or running Import to stop; returns it as it is now. */
235
270
  cancelImport(id: string): Promise<Import>;
236
271
  listItemProblems(importId: string, filter: ItemProblemsFilter): Promise<ItemProblemsPage>;
272
+ /**
273
+ * Every API key of the workspace, every importer's, newest first, without
274
+ * their secrets. Needs importhub's `importer`, as all three key calls do.
275
+ */
276
+ listApiKeys(): Promise<ApiKey[]>;
277
+ /**
278
+ * Creates an API key acting as the caller, with its Delegation Grant, and
279
+ * returns its secret this once (import-with-an-api-key:AC5).
280
+ */
281
+ createApiKey(input: CreateApiKeyInput): Promise<CreatedApiKey>;
282
+ /**
283
+ * Revokes an API key in odon and releases its Grant: it stops working at
284
+ * once (import-with-an-api-key:AC7).
285
+ */
286
+ revokeApiKey(id: string): Promise<void>;
237
287
  }
238
288
 
239
289
  /** How an Import ended (importhub.v1.ImportOutcome, CONTEXT.md "Import Outcome"). */
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as s, Fragment as P } from "react/jsx-runtime";
2
2
  import { useState as _, useEffect as ue, useMemo as ve } from "react";
3
3
  import { useTranslation as $ } from "react-i18next";
4
- import { I as F, l as D, m as te, u as Se, i as xe, M as Ce } from "./mapping-page-D92XwUq5.js";
4
+ import { I as F, l as D, m as te, u as Se, i as xe, M as Ce } from "./mapping-page-wJywO-hg.js";
5
5
  import { Button as H, StatusBadge as Ee, IconButton as B } from "@knkcs/anker/atoms";
6
6
  import { Card as y, NavList as Q } from "@knkcs/anker/components";
7
7
  import { Stack as h, Text as g, Textarea as me, Alert as K, Box as x, List as oe, HStack as ee, Heading as Ie, Code as $e, Separator as ae, Grid as he, RadioGroup as Fe, Radio as Ne } from "@knkcs/anker/primitives";