@cellarnode/ui 0.193.0 → 0.195.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.
- package/dist/components/certification-upload-card.d.ts.map +1 -1
- package/dist/components/certification-upload-card.js +5 -2
- package/dist/components/certification-upload-card.js.map +1 -1
- package/dist/components/confirmation-dialog.d.ts +3 -1
- package/dist/components/confirmation-dialog.d.ts.map +1 -1
- package/dist/components/confirmation-dialog.js +20 -2
- package/dist/components/confirmation-dialog.js.map +1 -1
- package/dist/components/copy-button.d.ts +23 -0
- package/dist/components/copy-button.d.ts.map +1 -0
- package/dist/components/copy-button.js +53 -0
- package/dist/components/copy-button.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/profile/api-keys/_story-fixtures.d.ts +3 -0
- package/dist/profile/api-keys/_story-fixtures.d.ts.map +1 -0
- package/dist/profile/api-keys/_story-fixtures.js +3 -0
- package/dist/profile/api-keys/_story-fixtures.js.map +1 -0
- package/dist/profile/api-keys/api-key-secret-reveal.d.ts +42 -0
- package/dist/profile/api-keys/api-key-secret-reveal.d.ts.map +1 -0
- package/dist/profile/api-keys/api-key-secret-reveal.js +56 -0
- package/dist/profile/api-keys/api-key-secret-reveal.js.map +1 -0
- package/dist/profile/api-keys/api-keys-card.d.ts +56 -0
- package/dist/profile/api-keys/api-keys-card.d.ts.map +1 -0
- package/dist/profile/api-keys/api-keys-card.js +77 -0
- package/dist/profile/api-keys/api-keys-card.js.map +1 -0
- package/dist/profile/api-keys/client-snippets.d.ts +20 -0
- package/dist/profile/api-keys/client-snippets.d.ts.map +1 -0
- package/dist/profile/api-keys/client-snippets.js +79 -0
- package/dist/profile/api-keys/client-snippets.js.map +1 -0
- package/dist/profile/api-keys/connected-apps-card.d.ts +39 -0
- package/dist/profile/api-keys/connected-apps-card.d.ts.map +1 -0
- package/dist/profile/api-keys/connected-apps-card.js +54 -0
- package/dist/profile/api-keys/connected-apps-card.js.map +1 -0
- package/dist/profile/api-keys/create-api-key-dialog.d.ts +51 -0
- package/dist/profile/api-keys/create-api-key-dialog.d.ts.map +1 -0
- package/dist/profile/api-keys/create-api-key-dialog.js +114 -0
- package/dist/profile/api-keys/create-api-key-dialog.js.map +1 -0
- package/dist/profile/api-keys/format.d.ts +20 -0
- package/dist/profile/api-keys/format.d.ts.map +1 -0
- package/dist/profile/api-keys/format.js +58 -0
- package/dist/profile/api-keys/format.js.map +1 -0
- package/dist/profile/api-keys/index.d.ts +19 -0
- package/dist/profile/api-keys/index.d.ts.map +1 -0
- package/dist/profile/api-keys/index.js +10 -0
- package/dist/profile/api-keys/index.js.map +1 -0
- package/dist/profile/api-keys/mock-client.d.ts +23 -0
- package/dist/profile/api-keys/mock-client.d.ts.map +1 -0
- package/dist/profile/api-keys/mock-client.js +167 -0
- package/dist/profile/api-keys/mock-client.js.map +1 -0
- package/dist/profile/api-keys/profile-keys-section.d.ts +36 -0
- package/dist/profile/api-keys/profile-keys-section.d.ts.map +1 -0
- package/dist/profile/api-keys/profile-keys-section.js +97 -0
- package/dist/profile/api-keys/profile-keys-section.js.map +1 -0
- package/dist/profile/api-keys/revoke-confirm.d.ts +26 -0
- package/dist/profile/api-keys/revoke-confirm.d.ts.map +1 -0
- package/dist/profile/api-keys/revoke-confirm.js +26 -0
- package/dist/profile/api-keys/revoke-confirm.js.map +1 -0
- package/dist/profile/api-keys/scope-list.d.ts +36 -0
- package/dist/profile/api-keys/scope-list.d.ts.map +1 -0
- package/dist/profile/api-keys/scope-list.js +29 -0
- package/dist/profile/api-keys/scope-list.js.map +1 -0
- package/dist/profile/api-keys/types.d.ts +111 -0
- package/dist/profile/api-keys/types.d.ts.map +1 -0
- package/dist/profile/api-keys/types.js +147 -0
- package/dist/profile/api-keys/types.js.map +1 -0
- package/dist/profile/index.d.ts +1 -0
- package/dist/profile/index.d.ts.map +1 -1
- package/dist/profile/index.js +2 -0
- package/dist/profile/index.js.map +1 -1
- package/dist/profile/profile.d.ts +3 -1
- package/dist/profile/profile.d.ts.map +1 -1
- package/dist/profile/profile.js +2 -2
- package/dist/profile/profile.js.map +1 -1
- package/package.json +1 -1
- package/src/theme/tokens.css +32 -10
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Personal API keys + connected apps (CEL-2308, spec 2026-10-05-mcp-remote-oauth-pats-health.md (e)/(f)).
|
|
3
|
+
*
|
|
4
|
+
* The components here are data-agnostic. A dashboard supplies a {@link ProfileKeysClient}
|
|
5
|
+
* (its own fetch layer over `/me/api-keys` and `/me/oauth-grants`); nothing in this package
|
|
6
|
+
* talks to the network. Raw keys exist ONLY in the create response: list rows carry the
|
|
7
|
+
* prefix and the last four characters, never the secret.
|
|
8
|
+
*/
|
|
9
|
+
/** The remote MCP surfaces a personal key can target. `admin` is deliberately absent: admin has no remote key. */
|
|
10
|
+
export type ApiKeySurface = "producer" | "importer" | "elabel" | "readonly";
|
|
11
|
+
export declare const API_KEY_SURFACES: readonly ["producer", "importer", "elabel", "readonly"];
|
|
12
|
+
export type ApiKeyStatus = "active" | "expired" | "revoked";
|
|
13
|
+
/** Product limits from the spec's decisions. */
|
|
14
|
+
export declare const API_KEY_LIMITS: {
|
|
15
|
+
/** Active personal keys per user per org. */
|
|
16
|
+
readonly maxKeys: 10;
|
|
17
|
+
readonly defaultExpiryDays: 90;
|
|
18
|
+
readonly maxExpiryDays: 365;
|
|
19
|
+
readonly expiryPresetDays: readonly [30, 90, 365];
|
|
20
|
+
/** Matches the backend limit. */
|
|
21
|
+
readonly maxNameLength: 100;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A surface id as received from the backend. The four known ones render with their catalog label and
|
|
25
|
+
* scopes; anything else (an older/newer backend, or `admin` slipping through) is shown generically and
|
|
26
|
+
* never throws.
|
|
27
|
+
*/
|
|
28
|
+
export type SurfaceId = ApiKeySurface | (string & {});
|
|
29
|
+
/** One personal key as listed (`GET /me/api-keys`). Never contains the secret. */
|
|
30
|
+
export interface ApiKeyRow {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
surface: SurfaceId;
|
|
34
|
+
/** Granted scope ids, e.g. `offers:read`. */
|
|
35
|
+
scopes: readonly string[];
|
|
36
|
+
/** First 12 characters of the key (`cnp_` + 8). */
|
|
37
|
+
prefix: string;
|
|
38
|
+
/** Last 4 characters. */
|
|
39
|
+
hint: string;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
expiresAt: string;
|
|
42
|
+
lastUsedAt: string | null;
|
|
43
|
+
status: ApiKeyStatus;
|
|
44
|
+
}
|
|
45
|
+
/** `POST /me/api-keys` response: the row plus the one-time secret. */
|
|
46
|
+
export interface CreatedApiKey extends ApiKeyRow {
|
|
47
|
+
key: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CreateApiKeyInput {
|
|
50
|
+
name: string;
|
|
51
|
+
surface: ApiKeySurface;
|
|
52
|
+
scopes: string[];
|
|
53
|
+
/** Exactly one of the two is set. */
|
|
54
|
+
expiresInDays?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Full ISO date-time in UTC (the backend rejects bare dates): the chosen day at 23:59:59.999 in the
|
|
57
|
+
* user's LOCAL timezone, converted to UTC and never later than creation + 365 days.
|
|
58
|
+
*/
|
|
59
|
+
expiresAt?: string;
|
|
60
|
+
}
|
|
61
|
+
/** One connected app (`GET /me/oauth-grants`). */
|
|
62
|
+
export interface OAuthGrantRow {
|
|
63
|
+
id: string;
|
|
64
|
+
clientName: string;
|
|
65
|
+
/** Host of the client's redirect URI, shown so an unverified app can be recognised. */
|
|
66
|
+
/** Host of the redirect URI; `null` when the backend cannot derive one. */
|
|
67
|
+
clientHost: string | null;
|
|
68
|
+
/** Dynamically registered or unverified client: shows the warning badge. */
|
|
69
|
+
unverified: boolean;
|
|
70
|
+
surface: SurfaceId;
|
|
71
|
+
scopes: readonly string[];
|
|
72
|
+
createdAt: string;
|
|
73
|
+
lastUsedAt: string | null;
|
|
74
|
+
}
|
|
75
|
+
/** The injected data layer. Each dashboard implements this over its API client. */
|
|
76
|
+
export interface ProfileKeysClient {
|
|
77
|
+
listKeys(): Promise<ApiKeyRow[]>;
|
|
78
|
+
createKey(input: CreateApiKeyInput): Promise<CreatedApiKey>;
|
|
79
|
+
revokeKey(id: string): Promise<void>;
|
|
80
|
+
listGrants(): Promise<OAuthGrantRow[]>;
|
|
81
|
+
revokeGrant(id: string): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
export interface ScopeInfo {
|
|
84
|
+
id: string;
|
|
85
|
+
/** Plain-language label (spec (b) consent labels). */
|
|
86
|
+
label: string;
|
|
87
|
+
access: "read" | "write";
|
|
88
|
+
}
|
|
89
|
+
export interface SurfaceInfo {
|
|
90
|
+
id: ApiKeySurface;
|
|
91
|
+
label: string;
|
|
92
|
+
description: string;
|
|
93
|
+
scopes: readonly ScopeInfo[];
|
|
94
|
+
}
|
|
95
|
+
/** Scopes per surface and their plain-language labels (spec (b) "Scopes" table). */
|
|
96
|
+
export declare const SURFACE_CATALOG: Readonly<Record<ApiKeySurface, SurfaceInfo>>;
|
|
97
|
+
/** Catalog entry for a surface, or a generic one (title-cased id, no known scopes) for anything unknown. */
|
|
98
|
+
export declare function surfaceInfo(surface: SurfaceId): SurfaceInfo;
|
|
99
|
+
/** Look up the plain label for a scope id (falls back to the id for scopes this build does not know). */
|
|
100
|
+
export declare function scopeLabel(surface: SurfaceId, scopeId: string): string;
|
|
101
|
+
export declare function readScopes(surface: SurfaceId): string[];
|
|
102
|
+
export declare function allScopes(surface: SurfaceId): string[];
|
|
103
|
+
/** True when the surface offers anything beyond reads. */
|
|
104
|
+
export declare function surfaceAllowsChanges(surface: SurfaceId): boolean;
|
|
105
|
+
export type ScopeSummaryKind = "read" | "write" | "custom";
|
|
106
|
+
/** "Read only", "Read and change" (everything the surface offers), or a custom subset. */
|
|
107
|
+
export declare function summarizeScopes(surface: SurfaceId, scopes: readonly string[]): ScopeSummaryKind;
|
|
108
|
+
/** The public MCP URL a client points at for a surface. */
|
|
109
|
+
export declare const MCP_BASE_URL = "https://mcp.cellarnode.com";
|
|
110
|
+
export declare const mcpUrl: (surface: SurfaceId, base?: string) => string;
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/profile/api-keys/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,kHAAkH;AAClH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE5E,eAAO,MAAM,gBAAgB,yDAA0D,CAAC;AAExF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5D,gDAAgD;AAChD,eAAO,MAAM,cAAc;IACzB,6CAA6C;;;;;IAK7C,iCAAiC;;CAEzB,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEtD,kFAAkF;AAClF,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,SAAS,CAAC;IACnB,6CAA6C;IAC7C,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,sEAAsE;AACtE,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI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AC;CAC9B;AAwBD,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CA+DxE,CAAC;AAIF,4GAA4G;AAC5G,wBAAgB,WAAW,CAAC,OAAO,EAAE,SAAS,GAAG,WAAW,CAI3D;AAED,yGAAyG;AACzG,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,EAAE,CAIvD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,EAAE,CAEtD;AAED,0DAA0D;AAC1D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAEhE;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,CAU/F;AAED,2DAA2D;AAC3D,eAAO,MAAM,YAAY,+BAA+B,CAAC;AACzD,eAAO,MAAM,MAAM,GAAI,SAAS,SAAS,EAAE,OAAM,MAAqB,KAAG,MAC/B,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Personal API keys + connected apps (CEL-2308, spec 2026-10-05-mcp-remote-oauth-pats-health.md (e)/(f)).
|
|
3
|
+
*
|
|
4
|
+
* The components here are data-agnostic. A dashboard supplies a {@link ProfileKeysClient}
|
|
5
|
+
* (its own fetch layer over `/me/api-keys` and `/me/oauth-grants`); nothing in this package
|
|
6
|
+
* talks to the network. Raw keys exist ONLY in the create response: list rows carry the
|
|
7
|
+
* prefix and the last four characters, never the secret.
|
|
8
|
+
*/
|
|
9
|
+
export const API_KEY_SURFACES = ["producer", "importer", "elabel", "readonly"];
|
|
10
|
+
/** Product limits from the spec's decisions. */
|
|
11
|
+
export const API_KEY_LIMITS = {
|
|
12
|
+
/** Active personal keys per user per org. */
|
|
13
|
+
maxKeys: 10,
|
|
14
|
+
defaultExpiryDays: 90,
|
|
15
|
+
maxExpiryDays: 365,
|
|
16
|
+
expiryPresetDays: [30, 90, 365],
|
|
17
|
+
/** Matches the backend limit. */
|
|
18
|
+
maxNameLength: 100,
|
|
19
|
+
};
|
|
20
|
+
const s = (id, label) => ({
|
|
21
|
+
id,
|
|
22
|
+
label,
|
|
23
|
+
access: id.endsWith(":read") ? "read" : "write",
|
|
24
|
+
});
|
|
25
|
+
const PORTFOLIO = s("portfolios:read", "See your portfolio");
|
|
26
|
+
const BEVERAGES_R = s("beverages:read", "See your beverages");
|
|
27
|
+
const BEVERAGES_W = s("beverages:write", "Change your beverages");
|
|
28
|
+
const VARIANTS_R = s("variants:read", "See product versions");
|
|
29
|
+
const VARIANTS_W = s("variants:write", "Change product versions");
|
|
30
|
+
const OFFERS_R = s("offers:read", "See offers");
|
|
31
|
+
const TENDERS_R = s("tenders:read", "See tenders");
|
|
32
|
+
const MATCH_R = s("matching:read", "See matches");
|
|
33
|
+
const EXTRACT_R = s("extraction:read", "See document imports");
|
|
34
|
+
const EXTRACT_W = s("extraction:write", "Start and review document imports");
|
|
35
|
+
const ATTACH_W = s("attachments:write", "Upload documents and certificates");
|
|
36
|
+
const NOTIFY_R = s("notifications:read", "See notifications");
|
|
37
|
+
const NOTIFY_M = s("notifications:manage", "Mark and dismiss notifications");
|
|
38
|
+
const SCHED_R = s("schedules:read", "See automations");
|
|
39
|
+
const SCHED_W = s("schedules:write", "Change automations");
|
|
40
|
+
/** Scopes per surface and their plain-language labels (spec (b) "Scopes" table). */
|
|
41
|
+
export const SURFACE_CATALOG = {
|
|
42
|
+
producer: {
|
|
43
|
+
id: "producer",
|
|
44
|
+
label: "Producer",
|
|
45
|
+
description: "Your portfolio, offers, matches and document imports.",
|
|
46
|
+
scopes: [
|
|
47
|
+
PORTFOLIO,
|
|
48
|
+
BEVERAGES_R,
|
|
49
|
+
BEVERAGES_W,
|
|
50
|
+
VARIANTS_R,
|
|
51
|
+
VARIANTS_W,
|
|
52
|
+
OFFERS_R,
|
|
53
|
+
s("offers:write", "Draft and submit offers"),
|
|
54
|
+
TENDERS_R,
|
|
55
|
+
MATCH_R,
|
|
56
|
+
s("matching:write", "Mark interest in matches"),
|
|
57
|
+
EXTRACT_R,
|
|
58
|
+
EXTRACT_W,
|
|
59
|
+
ATTACH_W,
|
|
60
|
+
NOTIFY_R,
|
|
61
|
+
NOTIFY_M,
|
|
62
|
+
SCHED_R,
|
|
63
|
+
SCHED_W,
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
importer: {
|
|
67
|
+
id: "importer",
|
|
68
|
+
label: "Importer",
|
|
69
|
+
description: "Tenders, offers you receive, and notifications.",
|
|
70
|
+
scopes: [
|
|
71
|
+
OFFERS_R,
|
|
72
|
+
s("offers:respond", "Respond to and accept offers"),
|
|
73
|
+
TENDERS_R,
|
|
74
|
+
s("tenders:write", "Create, edit and publish tenders"),
|
|
75
|
+
NOTIFY_R,
|
|
76
|
+
NOTIFY_M,
|
|
77
|
+
SCHED_R,
|
|
78
|
+
SCHED_W,
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
elabel: {
|
|
82
|
+
id: "elabel",
|
|
83
|
+
label: "E-label",
|
|
84
|
+
description: "Your portfolio and e-labels, including publishing.",
|
|
85
|
+
scopes: [
|
|
86
|
+
PORTFOLIO,
|
|
87
|
+
BEVERAGES_R,
|
|
88
|
+
BEVERAGES_W,
|
|
89
|
+
VARIANTS_R,
|
|
90
|
+
VARIANTS_W,
|
|
91
|
+
EXTRACT_R,
|
|
92
|
+
EXTRACT_W,
|
|
93
|
+
ATTACH_W,
|
|
94
|
+
s("elabel:read", "See e-labels"),
|
|
95
|
+
s("elabel:write", "Change e-labels, including publishing"),
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
readonly: {
|
|
99
|
+
id: "readonly",
|
|
100
|
+
label: "Read only",
|
|
101
|
+
description: "Look but never change: the safest choice for tools you do not fully control.",
|
|
102
|
+
scopes: [PORTFOLIO, BEVERAGES_R, VARIANTS_R, OFFERS_R, TENDERS_R, MATCH_R, EXTRACT_R],
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
const KNOWN_SURFACES = new Set(["producer", "importer", "elabel", "readonly"]);
|
|
106
|
+
/** Catalog entry for a surface, or a generic one (title-cased id, no known scopes) for anything unknown. */
|
|
107
|
+
export function surfaceInfo(surface) {
|
|
108
|
+
if (KNOWN_SURFACES.has(surface))
|
|
109
|
+
return SURFACE_CATALOG[surface];
|
|
110
|
+
const label = surface ? surface.charAt(0).toUpperCase() + surface.slice(1) : "Unknown";
|
|
111
|
+
return { id: "readonly", label, description: "", scopes: [] };
|
|
112
|
+
}
|
|
113
|
+
/** Look up the plain label for a scope id (falls back to the id for scopes this build does not know). */
|
|
114
|
+
export function scopeLabel(surface, scopeId) {
|
|
115
|
+
return surfaceInfo(surface).scopes.find((x) => x.id === scopeId)?.label ?? scopeId;
|
|
116
|
+
}
|
|
117
|
+
export function readScopes(surface) {
|
|
118
|
+
return surfaceInfo(surface)
|
|
119
|
+
.scopes.filter((x) => x.access === "read")
|
|
120
|
+
.map((x) => x.id);
|
|
121
|
+
}
|
|
122
|
+
export function allScopes(surface) {
|
|
123
|
+
return surfaceInfo(surface).scopes.map((x) => x.id);
|
|
124
|
+
}
|
|
125
|
+
/** True when the surface offers anything beyond reads. */
|
|
126
|
+
export function surfaceAllowsChanges(surface) {
|
|
127
|
+
return surfaceInfo(surface).scopes.some((x) => x.access === "write");
|
|
128
|
+
}
|
|
129
|
+
/** "Read only", "Read and change" (everything the surface offers), or a custom subset. */
|
|
130
|
+
export function summarizeScopes(surface, scopes) {
|
|
131
|
+
const set = new Set(scopes);
|
|
132
|
+
const all = allScopes(surface);
|
|
133
|
+
const reads = readScopes(surface);
|
|
134
|
+
if (all.length === 0)
|
|
135
|
+
return "custom"; // a surface this build does not know: never claim read-only
|
|
136
|
+
// Read is tested FIRST: on a surface with no write scopes (readonly) "everything" and "all reads"
|
|
137
|
+
// are the same set, and that set is Read only, never "Read and change".
|
|
138
|
+
if (reads.every((id) => set.has(id)) && set.size === reads.length)
|
|
139
|
+
return "read";
|
|
140
|
+
if (all.every((id) => set.has(id)) && set.size === all.length)
|
|
141
|
+
return "write";
|
|
142
|
+
return "custom";
|
|
143
|
+
}
|
|
144
|
+
/** The public MCP URL a client points at for a surface. */
|
|
145
|
+
export const MCP_BASE_URL = "https://mcp.cellarnode.com";
|
|
146
|
+
export const mcpUrl = (surface, base = MCP_BASE_URL) => `${base.replace(/\/+$/, "")}/${surface}`;
|
|
147
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/profile/api-keys/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAIxF,gDAAgD;AAChD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,6CAA6C;IAC7C,OAAO,EAAE,EAAE;IACX,iBAAiB,EAAE,EAAE;IACrB,aAAa,EAAE,GAAG;IAClB,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;IAC/B,iCAAiC;IACjC,aAAa,EAAE,GAAG;CACV,CAAC;AAqFX,MAAM,CAAC,GAAG,CAAC,EAAU,EAAE,KAAa,EAAa,EAAE,CAAC,CAAC;IACnD,EAAE;IACF,KAAK;IACL,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;CAChD,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,CAAC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AA0F;AAC1F,MAAM,UAAU,eAAe,CAAC,OAAkB,EAAE,MAAyB;IAC3E,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC,CAAC,4DAA4D;IACnG,kGAAkG;IAClG,wEAAwE;IACxE,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IACjF,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,MAAM;QAAE,OAAO,OAAO,CAAC;IAC9E,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAG,4BAA4B,CAAC;AACzD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAkB,EAAE,OAAe,YAAY,EAAU,EAAE,CAChF,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC"}
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -23,4 +23,5 @@ export type { AccountActionsCardProps, AccountActionsLabels } from "./account-ac
|
|
|
23
23
|
export { SubscriptionCard } from "./subscription-card.js";
|
|
24
24
|
export type { AccountSubscription, SubscriptionCardLabels, SubscriptionCardProps, } from "./subscription-card.js";
|
|
25
25
|
export * from "./importer-profile-view.js";
|
|
26
|
+
export * from "./api-keys/index.js";
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,2CAA2C,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EACV,2BAA2B,EAC3B,wBAAwB,EACxB,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EACV,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,cAA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AAC"}
|
package/dist/profile/index.js
CHANGED
|
@@ -19,4 +19,6 @@ export { AccountPreferencesCard } from "./account-preferences-card.js";
|
|
|
19
19
|
export { AccountActionsCard } from "./account-actions-card.js";
|
|
20
20
|
export { SubscriptionCard } from "./subscription-card.js";
|
|
21
21
|
export * from "./importer-profile-view.js";
|
|
22
|
+
// CEL-2308: personal API keys + connected apps (spec (e)/(f)). Data-agnostic; dashboards inject a ProfileKeysClient.
|
|
23
|
+
export * from "./api-keys/index.js";
|
|
22
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,yBAAyB,GAE1B,MAAM,2CAA2C,CAAC;AAEnD,iEAAiE;AACjE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAOtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAMvD,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,yBAAyB,GAE1B,MAAM,2CAA2C,CAAC;AAEnD,iEAAiE;AACjE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAOtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAMvD,cAAc,yBAAyB,CAAC;AAExC,qHAAqH;AACrH,cAAc,YAAY,CAAC"}
|
|
@@ -12,8 +12,10 @@ interface ProfileCardProps {
|
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
footer?: React.ReactNode;
|
|
14
14
|
className?: string;
|
|
15
|
+
/** Gives the heading an id and makes it programmatically focusable (e.g. to restore focus after a row is removed). */
|
|
16
|
+
headingId?: string | undefined;
|
|
15
17
|
}
|
|
16
|
-
export declare function ProfileCard({ title, description, children, footer, className }: ProfileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function ProfileCard({ title, description, children, footer, className, headingId, }: ProfileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
interface ProfileDetailRowProps {
|
|
18
20
|
icon: React.ReactNode;
|
|
19
21
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/profile/profile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAUvF;AAID,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/profile/profile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAUvF;AAID,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;I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@@ import { cn } from "../lib/utils.js";
|
|
|
3
3
|
export function ProfileShell({ title, subtitle, children, className }) {
|
|
4
4
|
return (_jsxs("div", { className: cn("max-w-4xl mx-auto flex flex-col gap-6", className), children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("h1", { className: "text-2xl font-bold tracking-tight text-foreground", children: title }), subtitle && _jsx("p", { className: "text-sm/6 text-muted-foreground", children: subtitle })] }), children] }));
|
|
5
5
|
}
|
|
6
|
-
export function ProfileCard({ title, description, children, footer, className }) {
|
|
7
|
-
return (_jsxs("div", { className: cn("border border-border/60 bg-card rounded-2xl overflow-hidden", className), children: [_jsxs("div", { className: "px-6 py-5 border-b border-border/60", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: title }), description && _jsx("p", { className: "mt-1 text-sm/5 text-muted-foreground", children: description })] }), _jsx("div", { className: "px-6 py-5", children: children }), footer && _jsx("div", { className: "px-6 py-4 bg-muted/30 border-t border-border/60", children: footer })] }));
|
|
6
|
+
export function ProfileCard({ title, description, children, footer, className, headingId, }) {
|
|
7
|
+
return (_jsxs("div", { className: cn("border border-border/60 bg-card rounded-2xl overflow-hidden", className), children: [_jsxs("div", { className: "px-6 py-5 border-b border-border/60", children: [_jsx("h2", { id: headingId, tabIndex: headingId ? -1 : undefined, className: "text-base font-semibold text-foreground focus-visible:outline-2 focus-visible:outline-ring", children: title }), description && _jsx("p", { className: "mt-1 text-sm/5 text-muted-foreground", children: description })] }), _jsx("div", { className: "px-6 py-5", children: children }), footer && _jsx("div", { className: "px-6 py-4 bg-muted/30 border-t border-border/60", children: footer })] }));
|
|
8
8
|
}
|
|
9
9
|
export function ProfileDetailRow({ icon, label, value, className }) {
|
|
10
10
|
// The wrapping <div> is a `dt-dd` group inside <dl>; per axe's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/profile/profile.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,C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,YAAG,QAAQ,GAAO,CAAC;AAC9F,CAAC;AAED,iFAAiF;AAEjF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE,cAAc;CACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cellarnode/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.195.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264",
|
package/src/theme/tokens.css
CHANGED
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
--color-chart-3: var(--chart-3);
|
|
50
50
|
--color-chart-4: var(--chart-4);
|
|
51
51
|
--color-chart-5: var(--chart-5);
|
|
52
|
+
--color-chart-6: var(--chart-6);
|
|
53
|
+
--color-chart-other: var(--chart-other);
|
|
52
54
|
--color-chart-bg: var(--chart-bg);
|
|
53
55
|
--color-chart-grid: var(--chart-grid);
|
|
54
56
|
--color-chart-tooltip-bg: var(--chart-tooltip-bg);
|
|
@@ -467,11 +469,21 @@
|
|
|
467
469
|
before nudging. */
|
|
468
470
|
--ring: var(--primary);
|
|
469
471
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
472
|
+
/* CEL-2292: categorical series palette, validated with the dataviz validator
|
|
473
|
+
(scripts/chart-palette.test.ts): OKLCH L in the 0.43-0.77 light band, C >= 0.10,
|
|
474
|
+
adjacent CVD dE >= 8 and normal-vision dE >= 15, >= 3:1 vs --card, and >= 10 dE from
|
|
475
|
+
every status token (none aliases success/warning/destructive/info, which are
|
|
476
|
+
reserved for state). Assign in order; never cycle; at most 6 series, fold the rest into
|
|
477
|
+
--chart-other. Hues: teal, orange, violet, plum, blue, olive (kept per slot in dark).
|
|
478
|
+
Light teal is deliberately brighter than --primary: --primary (L 0.40) sits below the
|
|
479
|
+
0.43 series lightness band. */
|
|
480
|
+
--chart-1: oklch(0.629 0.105 188.3);
|
|
481
|
+
--chart-2: oklch(0.65 0.15 59.8);
|
|
482
|
+
--chart-3: oklch(0.651 0.16 287.8);
|
|
483
|
+
--chart-4: oklch(0.451 0.16 336.2);
|
|
484
|
+
--chart-5: oklch(0.511 0.16 256);
|
|
485
|
+
--chart-6: oklch(0.449 0.115 128);
|
|
486
|
+
--chart-other: oklch(0.53 0.006 195);
|
|
475
487
|
|
|
476
488
|
/* Chart framework — Recharts/charting surfaces (CEL-41) */
|
|
477
489
|
--chart-bg: color-mix(in oklab, white 99%, var(--primary) 1%);
|
|
@@ -703,11 +715,16 @@
|
|
|
703
715
|
--input: color-mix(in oklab, black 68%, var(--primary) 32%);
|
|
704
716
|
--ring: color-mix(in oklab, white 24%, var(--primary) 76%);
|
|
705
717
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
--chart-
|
|
710
|
-
--chart-
|
|
718
|
+
/* CEL-2292: dark categorical palette (OKLCH L 0.48-0.67 band). Same hue family per slot as
|
|
719
|
+
the light block (teal, orange, violet, plum, blue, olive); only lightness/chroma adapt.
|
|
720
|
+
Passes the validator on adjacent AND all pairs. */
|
|
721
|
+
--chart-1: oklch(0.58 0.105 176.2);
|
|
722
|
+
--chart-2: oklch(0.54 0.139 52);
|
|
723
|
+
--chart-3: oklch(0.665 0.149 288.3);
|
|
724
|
+
--chart-4: oklch(0.52 0.199 336);
|
|
725
|
+
--chart-5: oklch(0.5 0.159 255.8);
|
|
726
|
+
--chart-6: oklch(0.669 0.159 120.1);
|
|
727
|
+
--chart-other: oklch(0.72 0.012 195);
|
|
711
728
|
|
|
712
729
|
/* Chart framework — dark theme (CEL-41) */
|
|
713
730
|
--chart-bg: color-mix(in oklab, black 76%, var(--primary) 24%);
|
|
@@ -964,6 +981,11 @@
|
|
|
964
981
|
to { transform: translateY(-50%) scale(1); }
|
|
965
982
|
}
|
|
966
983
|
|
|
984
|
+
@keyframes copy-check-pop {
|
|
985
|
+
from { transform: scale(0.5); opacity: 0; }
|
|
986
|
+
to { transform: scale(1); opacity: 1; }
|
|
987
|
+
}
|
|
988
|
+
|
|
967
989
|
@keyframes opportunity-highlight-wash {
|
|
968
990
|
from { opacity: 0; }
|
|
969
991
|
40% { opacity: 1; }
|