@redocly/framework-plugin-apigee 0.1.0-next.1 → 0.1.0-next.10
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/CHANGELOG.md +148 -0
- package/README.md +4 -4
- package/lib/.tsbuildinfo +1 -1
- package/lib/client/ApigeeTemplate.d.ts +3 -1
- package/lib/client/ApigeeTemplate.js +1 -1
- package/lib/client/Primitives.d.ts +39 -14
- package/lib/client/Primitives.js +193 -93
- package/lib/client/api.d.ts +0 -1
- package/lib/client/api.js +1 -1
- package/lib/client/context.d.ts +3 -1
- package/lib/client/hooks.d.ts +7 -10
- package/lib/client/hooks.js +1 -1
- package/lib/client/queries.d.ts +28 -0
- package/lib/client/queries.js +1 -0
- package/lib/client/views/AdminView.d.ts +3 -0
- package/lib/client/views/AdminView.js +5 -9
- package/lib/client/views/AppsView.d.ts +6 -7
- package/lib/client/views/AppsView.js +1 -5
- package/lib/client/views/TeamsView.d.ts +5 -7
- package/lib/client/views/TeamsView.js +1 -1
- package/lib/plugin.js +1 -1
- package/lib/server/service.d.ts +0 -2
- package/lib/server/service.js +1 -1
- package/package.json +7 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import { type AppSelection } from './views/AppsView.js';
|
|
3
|
+
import { type TeamTab } from './views/TeamsView.js';
|
|
3
4
|
type Route = {
|
|
4
5
|
view: 'apps';
|
|
5
6
|
selection: AppSelection;
|
|
@@ -8,6 +9,7 @@ type Route = {
|
|
|
8
9
|
} | {
|
|
9
10
|
view: 'team';
|
|
10
11
|
teamId: string;
|
|
12
|
+
tab: TeamTab;
|
|
11
13
|
} | {
|
|
12
14
|
view: 'admin';
|
|
13
15
|
};
|
|
@@ -20,5 +22,5 @@ type TemplateProps = {
|
|
|
20
22
|
metadata?: Record<string, unknown>;
|
|
21
23
|
};
|
|
22
24
|
};
|
|
23
|
-
export default function ApigeeTemplate(
|
|
25
|
+
export default function ApigeeTemplate(props: TemplateProps): ReactElement;
|
|
24
26
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{Fragment as U,jsx as e,jsxs as y}from"react/jsx-runtime";import{QueryClientProvider as j}from"@tanstack/react-query";import{useCallback as S,useMemo as V}from"react";import{useLocation as M}from"react-router";import{Button as O}from"@redocly/theme/components/Button/Button";import{ToastProvider as $}from"@redocly/theme/core/contexts/Toast/ToastProvider";import{useThemeHooks as B}from"@redocly/theme/core/hooks";import{APIGEE_DEFAULT_TITLE as F}from"../constants.js";import{ApigeeContext as N}from"./context.js";import{errorMessage as _}from"./hooks.js";import{EmptyState as H,ListSkeleton as W,Notice as f,Page as h,PageHeader as g,Tabs as z}from"./Primitives.js";import{queryClient as G,useApps as Q,useMeta as Y,useTeams as J}from"./queries.js";import{AdminView as K,ApprovalsDescription as X}from"./views/AdminView.js";import{APPS_DESCRIPTION as Z,AppsView as q}from"./views/AppsView.js";import{TEAMS_DESCRIPTION as ee,TeamDetailView as te,TeamsView as ie}from"./views/TeamsView.js";function ne(i,d,l){var o;const r=l==="/"?"":l,n=(i.startsWith(r)?i.slice(r.length):i).split("/").filter(Boolean).map(decodeURIComponent);if(n[0]==="teams")return n[1]?{view:"team",teamId:n[1],tab:n[2]==="members"?"members":"apps"}:{view:"teams"};if(n[0]==="admin")return{view:"admin"};if(n[0]){const a=(o=new URLSearchParams(d).get("team"))!==null&&o!==void 0?o:void 0;return{view:"apps",selection:{appId:n[0],teamId:a}}}return{view:"apps",selection:null}}function ae(i){return e(j,{client:G,children:e($,{children:e(oe,Object.assign({},i))})})}function oe({page:i}){var d,l,o;const r=M(),{userData:p,loginUrl:n}=B().useUserMenu(),a=i.slug.length>1&&i.slug.endsWith("/")?i.slug.slice(0,-1):i.slug,u=typeof((d=i.metadata)===null||d===void 0?void 0:d.title)=="string"?i.metadata.title:F,b=((l=i.metadata)===null||l===void 0?void 0:l.teamsEnabled)===!0,t=V(()=>ne(r.pathname,r.search,a),[r.pathname,r.search,a]),v=p?.isAuthenticated===!0,m=Y(v),A=J(v);Q(v);const c=S((s="",w)=>{const D=a==="/"?"":a,I=new URLSearchParams;for(const[R,E]of Object.entries(w??{}))E!==void 0&&I.set(R,E);const T=I.toString();return`${D}${s}${T?`?${T}`:""}`||"/"},[a]),x=S(s=>c(`/${encodeURIComponent(s.id)}`,{team:s.owner.kind==="team"?s.owner.teamId:void 0}),[c]);if(!v)return e(h,{children:e(H,{icon:"lock",title:"Sign in to manage your apps",text:"Your apps and their API keys are tied to your portal account.",action:n?e(O,{variant:"primary",onClick:()=>window.location.assign(n),children:"Sign in"}):void 0})});const C=[{type:"link",label:u,link:c(),icon:"key",active:t.view==="apps"},b?{type:"link",label:"Teams",link:c("/teams"),icon:"user-group",active:t.view==="teams"}:null,!((o=m.data)===null||o===void 0)&&o.approvals.canView?{type:"link",label:"Approvals",link:c("/admin"),icon:"shield-check",active:t.view==="admin"}:null],k=t.view==="team"||t.view==="apps"&&t.selection!==null,P=k?null:e(z,{items:C.filter(s=>s!==null)});if(!m.data)return e(h,{children:m.isError?e(f,{tone:"danger",children:_(m.error)}):y(U,{children:[P,t.view==="teams"?e(g,{title:"Teams",description:ee}):t.view==="admin"?e(g,{title:"Approvals",description:e(X,{organization:"\u2026"})}):k?e(g,{title:u}):e(g,{title:u,description:Z}),e(W,{label:"Loading\u2026"})]})});const L={meta:m.data,basePath:a,title:u,link:c,appLink:x};return e(N.Provider,{value:L,children:y(h,{"data-component-name":"Apigee/AppsPage","data-testid":"apigee-page",children:[P,A.isError?e(f,{tone:"danger",children:_(A.error)}):null,t.view==="apps"?e(q,{selection:t.selection}):t.view==="teams"?b?e(ie,{}):e(f,{tone:"warning",children:"Teams are disabled on this portal."}):t.view==="team"?e(te,{teamId:t.teamId,tab:t.tab}):m.data.approvals.canView?e(K,{}):e(f,{tone:"warning",children:"Only reviewers of an API product can open this page."})]})})}export{ae as default,ne as parseRoute};
|
|
@@ -16,15 +16,47 @@ export declare function Tabs({ items }: {
|
|
|
16
16
|
}): ReactElement;
|
|
17
17
|
export declare const TableWrap: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
18
18
|
export declare const Table: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>>> & string;
|
|
19
|
+
/** At phone width a row becomes a list item: `td.trail` beside the first cell, `td.meta` and
|
|
20
|
+
* `td.actions` on the next line, each other cell on a line of its own, `td.optional` hidden. */
|
|
21
|
+
export declare const ListTable: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>>, "as" | "forwardedAs"> & {
|
|
22
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
23
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
24
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>>, "as" | "forwardedAs"> & {
|
|
25
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
26
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
27
|
+
}, never>>> & string;
|
|
28
|
+
/** A row that opens `to` on a click anywhere outside the links it holds. */
|
|
29
|
+
export declare function LinkTableRow({ to, testId, children, }: {
|
|
30
|
+
to: string;
|
|
31
|
+
testId: string;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}): ReactElement;
|
|
19
34
|
export declare const Muted: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
20
35
|
export declare const Mono: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>>> & string;
|
|
21
36
|
export declare const Row: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
37
|
+
/** A filter select in a toolbar, sized to its options rather than the whole row. */
|
|
38
|
+
export declare const FilterSlot: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
39
|
+
export declare const Toolbar: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
40
|
+
export declare function SearchField({ value, onChange, placeholder, testId, }: {
|
|
41
|
+
value: string;
|
|
42
|
+
onChange: (value: string) => void;
|
|
43
|
+
placeholder: string;
|
|
44
|
+
testId?: string;
|
|
45
|
+
}): ReactElement;
|
|
46
|
+
/** Placeholder rows for a list that has never loaded; a refresh keeps showing the cached rows. */
|
|
47
|
+
export declare function ListSkeleton({ label, rows }: {
|
|
48
|
+
label: string;
|
|
49
|
+
rows?: number;
|
|
50
|
+
}): ReactElement;
|
|
22
51
|
export declare function EmptyState({ icon, title, text, action, }: {
|
|
23
52
|
icon: string;
|
|
24
53
|
title: ReactNode;
|
|
25
54
|
text?: ReactNode;
|
|
26
55
|
action?: ReactNode;
|
|
27
56
|
}): ReactElement;
|
|
57
|
+
export declare function NoMatches({ onClear }: {
|
|
58
|
+
onClear: () => void;
|
|
59
|
+
}): ReactElement;
|
|
28
60
|
export declare const Field: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>>> & string;
|
|
29
61
|
export declare const FieldLabel: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
30
62
|
/** The label of a field the form cannot be sent without; the input itself needs `required`. */
|
|
@@ -53,17 +85,18 @@ export declare function Notice({ tone, children, }: {
|
|
|
53
85
|
tone?: 'info' | 'success' | 'warning' | 'danger';
|
|
54
86
|
children: ReactNode;
|
|
55
87
|
}): ReactElement;
|
|
56
|
-
export declare function StatusTag({ status
|
|
88
|
+
export declare function StatusTag({ status }: {
|
|
57
89
|
status: ApprovalStatus;
|
|
58
|
-
|
|
90
|
+
}): ReactElement;
|
|
91
|
+
/** An API product, outlined in the colour of its status so it does not read as a status tag. */
|
|
92
|
+
export declare function ProductTag({ name, status, to, }: {
|
|
93
|
+
name: string;
|
|
94
|
+
status: ApprovalStatus;
|
|
95
|
+
to?: string;
|
|
59
96
|
}): ReactElement;
|
|
60
97
|
export declare const Overview: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDListElement>, HTMLDListElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDListElement>, HTMLDListElement>, never>>> & string;
|
|
61
98
|
export declare const Stats: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
62
99
|
export declare const Stat: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
63
|
-
export declare function Loading({ label }: {
|
|
64
|
-
label: string;
|
|
65
|
-
}): ReactElement;
|
|
66
|
-
export declare const ListTitle: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
67
100
|
export declare const PageBreadcrumbs: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<{
|
|
68
101
|
className?: string;
|
|
69
102
|
additionalBreadcrumbs?: import("@redocly/theme").BreadcrumbItem[];
|
|
@@ -71,11 +104,3 @@ export declare const PageBreadcrumbs: import("styled-components/dist/types.js").
|
|
|
71
104
|
className?: string;
|
|
72
105
|
additionalBreadcrumbs?: import("@redocly/theme").BreadcrumbItem[];
|
|
73
106
|
}, never>>> & string & Omit<typeof Breadcrumbs, keyof import("react").Component<any, {}, any>>;
|
|
74
|
-
export declare const LinkList: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
75
|
-
export declare function LinkRow({ to, title, subtitle, tag, testId, }: {
|
|
76
|
-
to: string;
|
|
77
|
-
title: ReactNode;
|
|
78
|
-
subtitle?: ReactNode;
|
|
79
|
-
tag?: ReactNode;
|
|
80
|
-
testId?: string;
|
|
81
|
-
}): ReactElement;
|
package/lib/client/Primitives.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useIsFetching as b}from"@tanstack/react-query";import{useEffect as u}from"react";import{useNavigate as y}from"react-router";import r,{keyframes as w}from"styled-components";import{Admonition as k}from"@redocly/theme/components/Admonition/Admonition";import{Breadcrumbs as z}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{Button as c}from"@redocly/theme/components/Button/Button";import{Link as T}from"@redocly/theme/components/Link/Link";import{SpinnerLoader as S}from"@redocly/theme/components/Loaders/SpinnerLoader";import{NavigationTab as L}from"@redocly/theme/components/NavigationTabs/NavigationTab";import{Portal as $}from"@redocly/theme/components/Portal/Portal";import{Tag as p}from"@redocly/theme/components/Tag/Tag";import{breakpoints as g}from"@redocly/theme/core/utils/media-css";import{CDNIcon as l}from"@redocly/theme/icons/CDNIcon/CDNIcon";const yr=r.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
max-width: 1200px;
|
|
4
4
|
margin: 0 auto;
|
|
@@ -6,14 +6,14 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
6
6
|
font-size: var(--font-size-base);
|
|
7
7
|
line-height: var(--line-height-base);
|
|
8
8
|
color: var(--text-color-primary);
|
|
9
|
-
`,
|
|
9
|
+
`,E=r.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: flex-start;
|
|
12
12
|
justify-content: space-between;
|
|
13
13
|
flex-wrap: wrap;
|
|
14
14
|
gap: var(--spacing-base);
|
|
15
15
|
margin-bottom: var(--spacing-lg);
|
|
16
|
-
`,
|
|
16
|
+
`,j=r.h1`
|
|
17
17
|
margin: 0;
|
|
18
18
|
font-size: var(--font-size-xl);
|
|
19
19
|
line-height: var(--line-height-xl);
|
|
@@ -21,36 +21,36 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
21
21
|
display: flex;
|
|
22
22
|
align-items: center;
|
|
23
23
|
gap: var(--spacing-sm);
|
|
24
|
-
`,
|
|
24
|
+
`,D=r.p`
|
|
25
25
|
margin: var(--spacing-xxs) 0 0;
|
|
26
26
|
color: var(--text-color-description);
|
|
27
27
|
max-width: 720px;
|
|
28
|
-
`,
|
|
28
|
+
`,P=r.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
align-items: center;
|
|
31
31
|
gap: var(--spacing-xs);
|
|
32
32
|
flex-wrap: wrap;
|
|
33
|
-
`;function
|
|
33
|
+
`;function R(){return b({queryKey:["apigee"],predicate:t=>t.state.data!==void 0})>0?e("span",{role:"status","aria-label":"Refreshing","data-testid":"apigee-refreshing",children:e(S,{color:"var(--text-color-description)",size:"14px"})}):null}function wr({title:a,description:t,actions:o}){return n(E,{children:[n("div",{children:[n(j,{children:[a,e(R,{})]}),t?e(D,{children:t}):null]}),o?e(P,{children:o}):null]})}const C=r.h2`
|
|
34
34
|
margin: 0 0 var(--spacing-sm);
|
|
35
35
|
font-size: var(--font-size-lg);
|
|
36
36
|
line-height: var(--line-height-lg);
|
|
37
37
|
font-weight: var(--font-weight-semibold);
|
|
38
|
-
`,
|
|
38
|
+
`,kr=r.section`
|
|
39
39
|
margin-top: var(--spacing-xl);
|
|
40
|
-
`,
|
|
40
|
+
`,zr=r.div`
|
|
41
41
|
display: flex;
|
|
42
42
|
align-items: center;
|
|
43
43
|
justify-content: space-between;
|
|
44
44
|
gap: var(--spacing-sm);
|
|
45
45
|
margin-bottom: var(--spacing-sm);
|
|
46
46
|
|
|
47
|
-
${
|
|
47
|
+
${C} {
|
|
48
48
|
margin: 0;
|
|
49
49
|
}
|
|
50
|
-
`,
|
|
50
|
+
`,N=r.nav`
|
|
51
51
|
border-bottom: var(--navigation-tabs-bottom-border);
|
|
52
52
|
margin-bottom: var(--spacing-lg);
|
|
53
|
-
|
|
53
|
+
`,A=r.ul`
|
|
54
54
|
display: flex;
|
|
55
55
|
gap: var(--navigation-tabs-gap);
|
|
56
56
|
height: var(--navigation-tabs-height);
|
|
@@ -58,11 +58,11 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
58
58
|
padding: 0;
|
|
59
59
|
overflow-x: auto;
|
|
60
60
|
scrollbar-width: none;
|
|
61
|
-
`;function
|
|
61
|
+
`;function Tr({items:a}){return e(N,{"aria-label":"Sections",children:e(A,{children:a.map(t=>e(L,{tab:t},t.link))})})}const B=r.div`
|
|
62
62
|
border: 1px solid var(--border-color-secondary);
|
|
63
63
|
border-radius: var(--border-radius-xl);
|
|
64
64
|
overflow-x: auto;
|
|
65
|
-
`,
|
|
65
|
+
`,I=r.table`
|
|
66
66
|
width: 100%;
|
|
67
67
|
border-collapse: collapse;
|
|
68
68
|
font-size: var(--font-size-base);
|
|
@@ -89,6 +89,22 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
89
89
|
background: var(--layer-color-hover);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
tbody tr.link {
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
td.chevron {
|
|
97
|
+
width: 1%;
|
|
98
|
+
vertical-align: middle;
|
|
99
|
+
color: var(--text-color-description);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
td a {
|
|
103
|
+
color: var(--text-color-primary);
|
|
104
|
+
font-weight: var(--font-weight-medium);
|
|
105
|
+
text-decoration: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
92
108
|
td.actions,
|
|
93
109
|
th.actions {
|
|
94
110
|
position: sticky;
|
|
@@ -108,7 +124,7 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
108
124
|
min-width: 260px;
|
|
109
125
|
}
|
|
110
126
|
|
|
111
|
-
@media (max-width: ${
|
|
127
|
+
@media (max-width: ${g.small}) {
|
|
112
128
|
thead {
|
|
113
129
|
display: none;
|
|
114
130
|
}
|
|
@@ -163,6 +179,10 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
163
179
|
position: relative;
|
|
164
180
|
}
|
|
165
181
|
|
|
182
|
+
td.chevron {
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
166
186
|
td.actions.menu {
|
|
167
187
|
position: absolute;
|
|
168
188
|
top: var(--spacing-xs);
|
|
@@ -170,20 +190,140 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
170
190
|
padding: 0;
|
|
171
191
|
}
|
|
172
192
|
}
|
|
173
|
-
`,
|
|
193
|
+
`,Sr=r(I)`
|
|
194
|
+
@media (max-width: ${g.small}) {
|
|
195
|
+
tr {
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-wrap: wrap;
|
|
198
|
+
align-items: flex-start;
|
|
199
|
+
column-gap: var(--spacing-xs);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
tr::after {
|
|
203
|
+
content: '';
|
|
204
|
+
flex-basis: 100%;
|
|
205
|
+
order: 1;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
td {
|
|
209
|
+
flex-basis: 100%;
|
|
210
|
+
order: 3;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
td:first-child {
|
|
214
|
+
flex: 1 1 0;
|
|
215
|
+
min-width: 0;
|
|
216
|
+
order: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
td.trail {
|
|
220
|
+
flex: none;
|
|
221
|
+
order: 1;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
td.meta,
|
|
225
|
+
td.actions {
|
|
226
|
+
flex: 0 1 auto;
|
|
227
|
+
min-width: 0;
|
|
228
|
+
order: 2;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
td.meta {
|
|
232
|
+
font-size: var(--font-size-sm);
|
|
233
|
+
line-height: var(--line-height-sm);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
td.actions,
|
|
237
|
+
td.actions:not(:empty) {
|
|
238
|
+
margin-left: auto;
|
|
239
|
+
padding: 0;
|
|
240
|
+
align-self: center;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
td.optional {
|
|
244
|
+
display: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
td[data-label]::before {
|
|
248
|
+
content: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
td.meta[data-label]::before {
|
|
252
|
+
content: attr(data-label) ' ';
|
|
253
|
+
display: inline;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
td.meta:has(~ td.meta)::after {
|
|
257
|
+
content: '·';
|
|
258
|
+
margin-left: var(--spacing-xs);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
`;function Lr({to:a,testId:t,children:o}){const i=y();return e("tr",{className:"link","data-testid":t,onClick:s=>{s.target instanceof Element&&s.target.closest("a")||i(a)},children:o})}const W=r.span`
|
|
174
262
|
color: var(--text-color-description);
|
|
175
263
|
font-size: var(--font-size-sm);
|
|
176
264
|
line-height: var(--line-height-sm);
|
|
177
|
-
|
|
265
|
+
`,$r=r.code`
|
|
178
266
|
font-family: var(--font-family-monospaced);
|
|
179
267
|
font-size: var(--font-size-sm);
|
|
180
268
|
white-space: nowrap;
|
|
181
|
-
`,
|
|
269
|
+
`,Er=r.div`
|
|
182
270
|
display: flex;
|
|
183
271
|
align-items: center;
|
|
184
272
|
gap: var(--spacing-xs);
|
|
185
273
|
flex-wrap: wrap;
|
|
186
|
-
`,
|
|
274
|
+
`,F=r.div`
|
|
275
|
+
min-width: 140px;
|
|
276
|
+
`,jr=r.div`
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
flex-wrap: wrap;
|
|
280
|
+
gap: var(--spacing-xs);
|
|
281
|
+
margin-bottom: var(--spacing-sm);
|
|
282
|
+
|
|
283
|
+
> :first-child {
|
|
284
|
+
flex: 1 1 240px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
> :last-child:not(:first-child, ${F}) {
|
|
288
|
+
margin-left: auto;
|
|
289
|
+
}
|
|
290
|
+
`,M=r.div`
|
|
291
|
+
position: relative;
|
|
292
|
+
max-width: 420px;
|
|
293
|
+
|
|
294
|
+
> svg {
|
|
295
|
+
position: absolute;
|
|
296
|
+
top: 50%;
|
|
297
|
+
left: var(--spacing-sm);
|
|
298
|
+
transform: translateY(-50%);
|
|
299
|
+
pointer-events: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
> input {
|
|
303
|
+
padding-left: calc(var(--spacing-sm) + 22px);
|
|
304
|
+
}
|
|
305
|
+
`;function Dr({value:a,onChange:t,placeholder:o,testId:i}){return n(M,{children:[e(l,{name:"magnifying-glass",size:"14px",color:"var(--text-color-description)"}),e(J,{type:"search",value:a,onChange:s=>t(s.target.value),placeholder:o,"aria-label":o,"data-testid":i})]})}const _=w`
|
|
306
|
+
from { opacity: 1; }
|
|
307
|
+
50% { opacity: 0.45; }
|
|
308
|
+
to { opacity: 1; }
|
|
309
|
+
`,q=r.div`
|
|
310
|
+
display: flex;
|
|
311
|
+
align-items: center;
|
|
312
|
+
gap: var(--spacing-base);
|
|
313
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
314
|
+
border-bottom: 1px solid var(--border-color-secondary);
|
|
315
|
+
|
|
316
|
+
&:last-child {
|
|
317
|
+
border-bottom: none;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
> span {
|
|
321
|
+
height: 12px;
|
|
322
|
+
border-radius: var(--border-radius);
|
|
323
|
+
background: var(--layer-color-hover);
|
|
324
|
+
animation: ${_} 1.4s ease-in-out infinite;
|
|
325
|
+
}
|
|
326
|
+
`;function Pr({label:a,rows:t=4}){return e(B,{role:"status","aria-label":a,"data-testid":"apigee-skeleton",children:Array.from({length:t},(o,i)=>n(q,{children:[e("span",{style:{width:"28%"}}),e("span",{style:{width:"18%"}}),e("span",{style:{flex:1}}),e("span",{style:{width:"10%"}})]},i))})}const H=r.div`
|
|
187
327
|
display: flex;
|
|
188
328
|
flex-direction: column;
|
|
189
329
|
align-items: center;
|
|
@@ -192,7 +332,7 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
192
332
|
border: 1px dashed var(--border-color-primary);
|
|
193
333
|
border-radius: var(--border-radius-xl);
|
|
194
334
|
text-align: center;
|
|
195
|
-
`,
|
|
335
|
+
`,O=r.div`
|
|
196
336
|
width: 48px;
|
|
197
337
|
height: 48px;
|
|
198
338
|
display: grid;
|
|
@@ -200,21 +340,21 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
200
340
|
border: 1px solid var(--border-color-secondary);
|
|
201
341
|
border-radius: var(--border-radius-lg);
|
|
202
342
|
background: var(--layer-color);
|
|
203
|
-
`,
|
|
343
|
+
`,K=r.div`
|
|
204
344
|
font-weight: var(--font-weight-semibold);
|
|
205
|
-
`;function
|
|
345
|
+
`;function U({icon:a,title:t,text:o,action:i}){return n(H,{"data-testid":"apigee-empty",children:[e(O,{children:e(l,{name:a,size:"24px"})}),e(K,{children:t}),o?e(W,{style:{maxWidth:420},children:o}):null,i]})}function Rr({onClear:a}){return e(U,{icon:"magnifying-glass",title:"Nothing matches the filters",action:e(c,{variant:"outlined",onClick:a,children:"Clear filters"})})}const Cr=r.label`
|
|
206
346
|
display: flex;
|
|
207
347
|
flex-direction: column;
|
|
208
348
|
gap: var(--spacing-xxs);
|
|
209
349
|
font-size: var(--font-size-base);
|
|
210
|
-
`,
|
|
350
|
+
`,Y=r.span`
|
|
211
351
|
font-weight: var(--font-weight-medium);
|
|
212
352
|
color: var(--text-color-secondary);
|
|
213
353
|
font-size: var(--font-size-sm);
|
|
214
|
-
`,
|
|
354
|
+
`,G=r.span`
|
|
215
355
|
margin-left: var(--spacing-xxs);
|
|
216
356
|
color: var(--schema-required-color);
|
|
217
|
-
`;function
|
|
357
|
+
`;function Nr({children:a}){return n(Y,{children:[a,e(G,{"aria-hidden":"true",children:"*"})]})}const v=`
|
|
218
358
|
width: 100%;
|
|
219
359
|
box-sizing: border-box;
|
|
220
360
|
padding: 5px var(--spacing-sm);
|
|
@@ -237,24 +377,24 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
237
377
|
&::placeholder {
|
|
238
378
|
color: var(--text-color-disabled);
|
|
239
379
|
}
|
|
240
|
-
`,
|
|
241
|
-
${
|
|
242
|
-
`,
|
|
243
|
-
${
|
|
380
|
+
`,J=r.input`
|
|
381
|
+
${v}
|
|
382
|
+
`,Ar=r.textarea`
|
|
383
|
+
${v}
|
|
244
384
|
min-height: 72px;
|
|
245
385
|
resize: vertical;
|
|
246
|
-
`,
|
|
386
|
+
`,Br=r.div`
|
|
247
387
|
display: flex;
|
|
248
388
|
flex-direction: column;
|
|
249
389
|
gap: var(--spacing-xs);
|
|
250
|
-
`,
|
|
390
|
+
`,Ir=r.label`
|
|
251
391
|
display: flex;
|
|
252
392
|
align-items: flex-start;
|
|
253
393
|
gap: var(--spacing-sm);
|
|
254
394
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
255
|
-
border: 1px solid ${({$checked:
|
|
395
|
+
border: 1px solid ${({$checked:a})=>a?"var(--input-border-color-hover)":"var(--border-color-secondary)"};
|
|
256
396
|
border-radius: var(--border-radius-lg);
|
|
257
|
-
background: ${({$checked:
|
|
397
|
+
background: ${({$checked:a})=>a?"var(--layer-color)":"transparent"};
|
|
258
398
|
cursor: pointer;
|
|
259
399
|
|
|
260
400
|
input {
|
|
@@ -266,12 +406,12 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
266
406
|
border-color: var(--input-border-color-hover);
|
|
267
407
|
background: var(--layer-color);
|
|
268
408
|
}
|
|
269
|
-
`,
|
|
409
|
+
`,Wr=r.span`
|
|
270
410
|
display: flex;
|
|
271
411
|
align-items: center;
|
|
272
412
|
gap: var(--spacing-xs);
|
|
273
413
|
font-weight: var(--font-weight-medium);
|
|
274
|
-
`,
|
|
414
|
+
`,Q=r.div`
|
|
275
415
|
position: fixed;
|
|
276
416
|
inset: 0;
|
|
277
417
|
background: var(--bg-color-modal-overlay);
|
|
@@ -280,9 +420,9 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
280
420
|
align-items: center;
|
|
281
421
|
justify-content: center;
|
|
282
422
|
padding: var(--spacing-base);
|
|
283
|
-
`,
|
|
423
|
+
`,V=r.div`
|
|
284
424
|
width: 100%;
|
|
285
|
-
max-width: ${({$wide:
|
|
425
|
+
max-width: ${({$wide:a})=>a?"640px":"480px"};
|
|
286
426
|
max-height: calc(100vh - 64px);
|
|
287
427
|
display: flex;
|
|
288
428
|
flex-direction: column;
|
|
@@ -292,32 +432,39 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
292
432
|
box-shadow: var(--modal-box-shadow);
|
|
293
433
|
overflow: hidden;
|
|
294
434
|
font-family: var(--font-family-base);
|
|
295
|
-
`,
|
|
435
|
+
`,X=r.div`
|
|
296
436
|
display: flex;
|
|
297
437
|
align-items: center;
|
|
298
438
|
justify-content: space-between;
|
|
299
439
|
gap: var(--spacing-sm);
|
|
300
440
|
padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
|
|
301
|
-
`,
|
|
441
|
+
`,Z=r.h2`
|
|
302
442
|
margin: 0;
|
|
303
443
|
font-size: var(--font-size-lg);
|
|
304
444
|
line-height: var(--line-height-lg);
|
|
305
445
|
font-weight: var(--font-weight-semibold);
|
|
306
|
-
`,
|
|
446
|
+
`,rr=r.div`
|
|
307
447
|
display: flex;
|
|
308
448
|
flex-direction: column;
|
|
309
449
|
gap: var(--spacing-base);
|
|
310
450
|
padding: 0 var(--spacing-lg) var(--spacing-md);
|
|
311
451
|
overflow-y: auto;
|
|
312
|
-
`,
|
|
452
|
+
`,er=r.div`
|
|
313
453
|
display: flex;
|
|
314
454
|
justify-content: flex-end;
|
|
315
455
|
gap: var(--spacing-xs);
|
|
316
456
|
padding: var(--spacing-base) var(--spacing-lg);
|
|
317
457
|
border-top: 1px solid var(--border-color-secondary);
|
|
318
|
-
`;function
|
|
458
|
+
`;function Fr({title:a,open:t,onClose:o,children:i,footer:s,wide:x,testId:h}){return u(()=>{if(!t)return;const d=f=>{f.key==="Escape"&&o()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t,o]),t?e($,{children:e(Q,{onMouseDown:d=>d.target===d.currentTarget&&o(),children:n(V,{role:"dialog","aria-modal":"true",$wide:x,"data-testid":h,children:[n(X,{children:[e(Z,{children:a}),e(c,{variant:"text",size:"small",onClick:o,"aria-label":"Close",icon:e(l,{name:"xmark",size:"16px"})})]}),e(rr,{children:i}),s?e(er,{children:s}):null]})})}):null}const ar=r.div`
|
|
319
459
|
--admonition-margin: 0;
|
|
320
|
-
`;function
|
|
460
|
+
`;function Mr({tone:a="info",children:t}){return e(ar,{role:a==="danger"?"alert":"status","data-testid":`apigee-notice-${a}`,children:e(k,{type:a,children:t})})}const m={approved:"green",pending:"orange",revoked:"red"},tr={approved:"Approved",pending:"Pending approval",revoked:"Revoked"},or=r(T)`
|
|
461
|
+
display: inline-flex;
|
|
462
|
+
text-decoration: none;
|
|
463
|
+
|
|
464
|
+
&:hover {
|
|
465
|
+
text-decoration: none;
|
|
466
|
+
}
|
|
467
|
+
`;function _r({status:a}){return e(p,{color:m[a],children:tr[a]})}function qr({name:a,status:t,to:o}){const i=e(p,{color:m[t],variant:"outline",selectable:!!o,children:a});return o?e(or,{to:o,children:i}):i}const Hr=r.dl`
|
|
321
468
|
display: grid;
|
|
322
469
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
323
470
|
gap: var(--spacing-base);
|
|
@@ -350,12 +497,12 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
350
497
|
flex-wrap: wrap;
|
|
351
498
|
overflow-wrap: anywhere;
|
|
352
499
|
}
|
|
353
|
-
`,
|
|
500
|
+
`,Or=r.div`
|
|
354
501
|
display: flex;
|
|
355
502
|
gap: var(--spacing-base);
|
|
356
503
|
flex-wrap: wrap;
|
|
357
504
|
margin-bottom: var(--spacing-lg);
|
|
358
|
-
|
|
505
|
+
`,Kr=r.div`
|
|
359
506
|
flex: 1 1 160px;
|
|
360
507
|
padding: var(--spacing-base) var(--spacing-md);
|
|
361
508
|
border: 1px solid var(--border-color-secondary);
|
|
@@ -368,53 +515,6 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as m}from"rea
|
|
|
368
515
|
line-height: var(--line-height-xl);
|
|
369
516
|
font-weight: var(--font-weight-semibold);
|
|
370
517
|
}
|
|
371
|
-
`,
|
|
372
|
-
display: flex;
|
|
373
|
-
justify-content: center;
|
|
374
|
-
padding: var(--spacing-xl);
|
|
375
|
-
`;function Pr({label:e}){return o(K,{role:"status","aria-label":e,children:o(y,{color:"var(--text-color-description)",size:"24px"})})}const Wr=r.div`
|
|
376
|
-
display: flex;
|
|
377
|
-
align-items: center;
|
|
378
|
-
justify-content: space-between;
|
|
379
|
-
padding: 0 var(--spacing-sm) var(--spacing-xs);
|
|
380
|
-
font-size: var(--font-size-sm);
|
|
381
|
-
font-weight: var(--font-weight-medium);
|
|
382
|
-
color: var(--text-color-secondary);
|
|
383
|
-
`,Ar=r(b)`
|
|
518
|
+
`,Ur=r(z)`
|
|
384
519
|
margin-bottom: var(--spacing-sm);
|
|
385
|
-
|
|
386
|
-
border: 1px solid var(--border-color-secondary);
|
|
387
|
-
border-radius: var(--border-radius-xl);
|
|
388
|
-
overflow: hidden;
|
|
389
|
-
`,G=r(u)`
|
|
390
|
-
display: flex;
|
|
391
|
-
align-items: center;
|
|
392
|
-
gap: var(--spacing-sm);
|
|
393
|
-
padding: var(--spacing-sm) var(--spacing-base);
|
|
394
|
-
border-bottom: 1px solid var(--border-color-secondary);
|
|
395
|
-
color: var(--text-color-primary);
|
|
396
|
-
text-decoration: none;
|
|
397
|
-
|
|
398
|
-
&:last-child {
|
|
399
|
-
border-bottom: none;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
&:hover {
|
|
403
|
-
background: var(--layer-color-hover);
|
|
404
|
-
color: var(--text-color-primary);
|
|
405
|
-
text-decoration: none;
|
|
406
|
-
}
|
|
407
|
-
`,J=r.span`
|
|
408
|
-
display: flex;
|
|
409
|
-
flex-direction: column;
|
|
410
|
-
flex: 1;
|
|
411
|
-
min-width: 0;
|
|
412
|
-
|
|
413
|
-
> * {
|
|
414
|
-
overflow: hidden;
|
|
415
|
-
text-overflow: ellipsis;
|
|
416
|
-
white-space: nowrap;
|
|
417
|
-
}
|
|
418
|
-
`,Q=r.span`
|
|
419
|
-
font-weight: var(--font-weight-medium);
|
|
420
|
-
`;function Ir({to:e,title:a,subtitle:i,tag:n,testId:d}){return t(G,{to:e,"data-testid":d,children:[t(J,{children:[o(Q,{children:a}),i?o(c,{children:i}):null]}),n,o(l,{name:"chevron-right",size:"14px"})]})}export{Tr as CheckItem,Lr as CheckItemTitle,zr as CheckList,Sr as Dialog,fr as EmptyState,ur as Field,B as FieldLabel,wr as Input,Br as LinkList,Ir as LinkRow,Wr as ListTitle,Pr as Loading,hr as Mono,c as Muted,jr as Notice,Er as Overview,lr as Page,Ar as PageBreadcrumbs,cr as PageHeader,yr as RequiredLabel,br as Row,pr as Section,gr as SectionHeader,E as SectionTitle,$r as Stat,Rr as Stats,Dr as StatusTag,mr as Table,xr as TableWrap,vr as Tabs,kr as Textarea};
|
|
520
|
+
`;export{Ir as CheckItem,Wr as CheckItemTitle,Br as CheckList,Fr as Dialog,U as EmptyState,Cr as Field,Y as FieldLabel,F as FilterSlot,J as Input,Lr as LinkTableRow,Pr as ListSkeleton,Sr as ListTable,$r as Mono,W as Muted,Rr as NoMatches,Mr as Notice,Hr as Overview,yr as Page,Ur as PageBreadcrumbs,wr as PageHeader,qr as ProductTag,Nr as RequiredLabel,Er as Row,Dr as SearchField,kr as Section,zr as SectionHeader,C as SectionTitle,Kr as Stat,Or as Stats,_r as StatusTag,I as Table,B as TableWrap,Tr as Tabs,Ar as Textarea,jr as Toolbar};
|
package/lib/client/api.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export declare const apigeeApi: {
|
|
|
15
15
|
deleteKey: (appId: string, consumerKey: string, teamId?: string) => Promise<void>;
|
|
16
16
|
listTeams: () => Promise<Team[]>;
|
|
17
17
|
createTeam: (input: TeamInput) => Promise<Team>;
|
|
18
|
-
getTeam: (teamId: string) => Promise<Team>;
|
|
19
18
|
updateTeam: (teamId: string, input: TeamInput) => Promise<Team>;
|
|
20
19
|
deleteTeam: (teamId: string) => Promise<void>;
|
|
21
20
|
addMember: (teamId: string, input: TeamMemberInput) => Promise<Team>;
|
package/lib/client/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var b=function(e,n,t,i){function
|
|
1
|
+
var b=function(e,n,t,i){function p(d){return d instanceof t?d:new t(function(r){r(d)})}return new(t||(t=Promise))(function(d,r){function u(m){try{l(i.next(m))}catch(f){r(f)}}function h(m){try{l(i.throw(m))}catch(f){r(f)}}function l(m){m.done?d(m.value):p(m.value).then(u,h)}l((i=i.apply(e,n||[])).next())})};import{withPathPrefix as j}from"@redocly/theme/core/utils";import{APIGEE_ROUTES as o}from"../constants.js";class y extends Error{constructor(n,t){super(t),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ApiRequestError"})}}function s(e,n,t){let i=e;for(const[r,u]of Object.entries(n))i=i.replace(`:${r}`,encodeURIComponent(u));const p=new URLSearchParams;for(const[r,u]of Object.entries(t??{}))u!==void 0&&u!==""&&p.set(r,u);const d=p.toString();return j(d?`${i}?${d}`:i)}function a(e){return b(this,arguments,void 0,function*(n,t={}){var i;const p=yield fetch(n,Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({Accept:"application/json"},t.json!==void 0?{"Content-Type":"application/json"}:{}),(i=t.headers)!==null&&i!==void 0?i:{}),body:t.json!==void 0?JSON.stringify(t.json):t.body}));if(p.status===204)return;const d=yield p.text();let r=null;try{r=d?JSON.parse(d):null}catch{r=null}if(!p.ok){const u=r&&typeof r=="object"&&typeof r.error=="string"?r.error:`Request failed with ${p.status}`;throw new y(p.status,u)}return r})}const c=e=>({team:e}),O={meta:()=>a(s(o.meta,{})),listApps:()=>a(s(o.apps,{})),createApp:e=>a(s(o.apps,{}),{method:"POST",json:e}),updateApp:(e,n,t)=>a(s(o.app,{appId:e},c(t)),{method:"PUT",json:n}),deleteApp:(e,n)=>a(s(o.app,{appId:e},c(n)),{method:"DELETE"}),createKey:(e,n,t)=>a(s(o.appKeys,{appId:e},c(t)),{method:"POST",json:n}),updateKey:(e,n,t,i)=>a(s(o.appKey,{appId:e,consumerKey:n},c(i)),{method:"PUT",json:t}),deleteKey:(e,n,t)=>a(s(o.appKey,{appId:e,consumerKey:n},c(t)),{method:"DELETE"}),listTeams:()=>a(s(o.teams,{})),createTeam:e=>a(s(o.teams,{}),{method:"POST",json:e}),updateTeam:(e,n)=>a(s(o.team,{teamId:e}),{method:"PUT",json:n}),deleteTeam:e=>a(s(o.team,{teamId:e}),{method:"DELETE"}),addMember:(e,n)=>a(s(o.teamMembers,{teamId:e}),{method:"POST",json:n}),setMemberRole:(e,n,t)=>a(s(o.teamMember,{teamId:e,email:n}),{method:"PUT",json:{role:t}}),removeMember:(e,n)=>a(s(o.teamMember,{teamId:e,email:n}),{method:"DELETE"}),adminRequests:()=>a(s(o.adminRequests,{})),adminDecide:(e,n,t)=>a(s(n==="approve"?o.adminRequestApprove:o.adminRequestRevoke,{requestId:e}),{method:"POST",json:t?{note:t}:{}}),adminApps:()=>a(s(o.adminApps,{})),adminAudit:()=>a(s(o.adminAudit,{}))};export{y as ApiRequestError,O as apigeeApi};
|