@workos-inc/widgets 1.9.1 → 1.10.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/CHANGELOG.md +4 -0
- package/dist/cjs/admin-portal-audit-log-streaming.client.cjs +167 -0
- package/dist/cjs/admin-portal-audit-log-streaming.client.cjs.map +1 -0
- package/dist/cjs/admin-portal-audit-log-streaming.client.d.cts +26 -0
- package/dist/cjs/api/api-provider.cjs.map +1 -1
- package/dist/cjs/api/api-provider.d.cts +1 -1
- package/dist/cjs/index.cjs +11 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -0
- package/dist/cjs/lib/admin-portal-audit-log-streaming.cjs +321 -0
- package/dist/cjs/lib/admin-portal-audit-log-streaming.cjs.map +1 -0
- package/dist/cjs/lib/admin-portal-audit-log-streaming.d.cts +54 -0
- package/dist/cjs/lib/audit-log-stream-icons.cjs +63 -0
- package/dist/cjs/lib/audit-log-stream-icons.cjs.map +1 -0
- package/dist/cjs/lib/audit-log-stream-icons.d.cts +5 -0
- package/dist/cjs/lib/identity-providers.d.cts +2 -2
- package/dist/esm/admin-portal-audit-log-streaming.client.d.ts +26 -0
- package/dist/esm/admin-portal-audit-log-streaming.client.js +153 -0
- package/dist/esm/admin-portal-audit-log-streaming.client.js.map +1 -0
- package/dist/esm/api/api-provider.d.ts +1 -1
- package/dist/esm/api/api-provider.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/admin-portal-audit-log-streaming.d.ts +54 -0
- package/dist/esm/lib/admin-portal-audit-log-streaming.js +290 -0
- package/dist/esm/lib/admin-portal-audit-log-streaming.js.map +1 -0
- package/dist/esm/lib/audit-log-stream-icons.d.ts +5 -0
- package/dist/esm/lib/audit-log-stream-icons.js +39 -0
- package/dist/esm/lib/audit-log-stream-icons.js.map +1 -0
- package/dist/esm/lib/identity-providers.d.ts +2 -2
- package/package.json +3 -3
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Box, Card, Flex, Text } from "@radix-ui/themes";
|
|
5
|
+
import * as CardList from "./card-list.js";
|
|
6
|
+
import { Button, Skeleton } from "./elements.js";
|
|
7
|
+
import {
|
|
8
|
+
ExternalLinkIcon,
|
|
9
|
+
Cross2Icon,
|
|
10
|
+
InfoCircledIcon
|
|
11
|
+
} from "@radix-ui/react-icons";
|
|
12
|
+
import { ProviderIcon } from "./provider-icon.js";
|
|
13
|
+
import { IconPanel } from "./icon-panel.js";
|
|
14
|
+
import { GenericHttpsIcon } from "./audit-log-stream-icons.js";
|
|
15
|
+
import { Status } from "./status.js";
|
|
16
|
+
import {
|
|
17
|
+
getDomProps
|
|
18
|
+
} from "./utils.js";
|
|
19
|
+
import { Translation } from "./i18n/translation.js";
|
|
20
|
+
import { useTranslation } from "./i18n/use-translation.js";
|
|
21
|
+
import { getErrorMessage } from "./generic-error.js";
|
|
22
|
+
const AdminPortalAuditLogStreamingContext = React.createContext(null);
|
|
23
|
+
function useAdminPortalAuditLogStreamingContext() {
|
|
24
|
+
const context = React.useContext(AdminPortalAuditLogStreamingContext);
|
|
25
|
+
if (!context) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
"useAdminPortalAuditLogStreamingContext must be used within a AdminPortalAuditLogStreamingContext provider"
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return context;
|
|
31
|
+
}
|
|
32
|
+
function getDestinationName(type) {
|
|
33
|
+
switch (type) {
|
|
34
|
+
case "Datadog":
|
|
35
|
+
return "Datadog";
|
|
36
|
+
case "Splunk":
|
|
37
|
+
return "Splunk";
|
|
38
|
+
case "S3":
|
|
39
|
+
return "AWS S3";
|
|
40
|
+
case "GoogleCloudStorage":
|
|
41
|
+
return "Google Cloud Storage";
|
|
42
|
+
case "AzureSentinel":
|
|
43
|
+
return "Azure Sentinel";
|
|
44
|
+
case "GenericHttps":
|
|
45
|
+
return "Generic HTTPS";
|
|
46
|
+
default:
|
|
47
|
+
return type;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function getDestinationIcon(type) {
|
|
51
|
+
switch (type) {
|
|
52
|
+
case "Datadog":
|
|
53
|
+
return "datadog";
|
|
54
|
+
case "Splunk":
|
|
55
|
+
return "splunk";
|
|
56
|
+
case "S3":
|
|
57
|
+
return "aws";
|
|
58
|
+
case "GoogleCloudStorage":
|
|
59
|
+
return "google-cloud";
|
|
60
|
+
case "AzureSentinel":
|
|
61
|
+
return "azure";
|
|
62
|
+
default:
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function getWidgetRootDomProps(state, domProps) {
|
|
67
|
+
return getDomProps({
|
|
68
|
+
...domProps,
|
|
69
|
+
isWidgetRoot: true,
|
|
70
|
+
widgetId: "admin-portal-audit-log-streaming",
|
|
71
|
+
widgetState: state
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const CROCKFORD_BASE32 = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
75
|
+
function decodeUlidTimestamp(ulid) {
|
|
76
|
+
if (!ulid || ulid.length < 10) return null;
|
|
77
|
+
let timestamp = 0;
|
|
78
|
+
for (let i = 0; i < 10; i++) {
|
|
79
|
+
const charIndex = CROCKFORD_BASE32.indexOf(ulid.charAt(i).toUpperCase());
|
|
80
|
+
if (charIndex === -1) return null;
|
|
81
|
+
timestamp = timestamp * 32 + charIndex;
|
|
82
|
+
}
|
|
83
|
+
return new Date(timestamp);
|
|
84
|
+
}
|
|
85
|
+
function getRelativeTimeString(currentDate, pastDate) {
|
|
86
|
+
const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
87
|
+
const diff = pastDate.getTime() - currentDate.getTime();
|
|
88
|
+
const diffSeconds = Math.round(diff / 1e3);
|
|
89
|
+
const diffMinutes = Math.round(diffSeconds / 60);
|
|
90
|
+
const diffHours = Math.round(diffMinutes / 60);
|
|
91
|
+
const diffDays = Math.round(diffHours / 24);
|
|
92
|
+
const diffMonths = Math.round(diffDays / 30);
|
|
93
|
+
const diffYears = Math.round(diffMonths / 12);
|
|
94
|
+
if (Math.abs(diffSeconds) < 60) return "now";
|
|
95
|
+
if (Math.abs(diffMinutes) < 60) return rtf.format(diffMinutes, "minute");
|
|
96
|
+
if (Math.abs(diffHours) < 24) return rtf.format(diffHours, "hour");
|
|
97
|
+
if (Math.abs(diffDays) < 30) return rtf.format(diffDays, "day");
|
|
98
|
+
if (Math.abs(diffMonths) < 12) return rtf.format(diffMonths, "month");
|
|
99
|
+
return rtf.format(diffYears, "year");
|
|
100
|
+
}
|
|
101
|
+
function AdminPortalAuditLogStreamingButton({
|
|
102
|
+
isPending,
|
|
103
|
+
href,
|
|
104
|
+
initConfig
|
|
105
|
+
}) {
|
|
106
|
+
const { connectionStatus } = useAdminPortalAuditLogStreamingContext();
|
|
107
|
+
const label = (() => {
|
|
108
|
+
switch (connectionStatus) {
|
|
109
|
+
case "NotConfigured":
|
|
110
|
+
return /* @__PURE__ */ jsx(
|
|
111
|
+
Translation,
|
|
112
|
+
{
|
|
113
|
+
defaultMessage: "Set up Log Streams",
|
|
114
|
+
id: "s3Wu7U",
|
|
115
|
+
description: "Button label to start log stream setup"
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
case "Inactive":
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
Translation,
|
|
121
|
+
{
|
|
122
|
+
defaultMessage: "Continue setup",
|
|
123
|
+
id: "/oM/HY",
|
|
124
|
+
description: "Button label to continue incomplete log stream setup"
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
case "Active":
|
|
128
|
+
case "Error":
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
Translation,
|
|
131
|
+
{
|
|
132
|
+
defaultMessage: "Manage",
|
|
133
|
+
id: "+k5uUi",
|
|
134
|
+
description: "Button label to manage log stream settings"
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
})();
|
|
139
|
+
if (href) {
|
|
140
|
+
return /* @__PURE__ */ jsx(Button, { variant: "secondary", asChild: true, children: /* @__PURE__ */ jsxs("a", { href, target: "_blank", rel: "noopener noreferrer", children: [
|
|
141
|
+
label,
|
|
142
|
+
" ",
|
|
143
|
+
/* @__PURE__ */ jsx(ExternalLinkIcon, { "aria-hidden": true })
|
|
144
|
+
] }) });
|
|
145
|
+
}
|
|
146
|
+
return /* @__PURE__ */ jsxs(
|
|
147
|
+
Button,
|
|
148
|
+
{
|
|
149
|
+
variant: "secondary",
|
|
150
|
+
loading: isPending,
|
|
151
|
+
disabled: isPending,
|
|
152
|
+
onClick: initConfig,
|
|
153
|
+
children: [
|
|
154
|
+
label,
|
|
155
|
+
" ",
|
|
156
|
+
/* @__PURE__ */ jsx(ExternalLinkIcon, { "aria-hidden": true })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
const AdminPortalAuditLogStreaming = (props) => {
|
|
162
|
+
const { connectionStatus, adminPortalOpenButton, className } = props;
|
|
163
|
+
const destinationType = connectionStatus !== "NotConfigured" ? props.destinationType : null;
|
|
164
|
+
const lastSyncedEventId = connectionStatus === "Active" || connectionStatus === "Error" ? props.lastSyncedEventId : void 0;
|
|
165
|
+
const lastSyncedAt = lastSyncedEventId ? decodeUlidTimestamp(lastSyncedEventId) : null;
|
|
166
|
+
const icon = destinationType ? getDestinationIcon(destinationType) : null;
|
|
167
|
+
return /* @__PURE__ */ jsx(AdminPortalAuditLogStreamingContext.Provider, { value: { connectionStatus }, children: /* @__PURE__ */ jsxs(CardList.Root, { ...getWidgetRootDomProps("resolved", { className }), children: [
|
|
168
|
+
/* @__PURE__ */ jsx(CardList.Item, { children: /* @__PURE__ */ jsxs(Flex, { direction: "row", justify: "between", align: "center", gap: "2", children: [
|
|
169
|
+
/* @__PURE__ */ jsx(Flex, { gap: "4", align: "center", children: connectionStatus === "NotConfigured" ? /* @__PURE__ */ jsx(Text, { size: "2", color: "gray", children: /* @__PURE__ */ jsx(
|
|
170
|
+
Translation,
|
|
171
|
+
{
|
|
172
|
+
defaultMessage: "You haven't set up Log Streams yet.",
|
|
173
|
+
id: "n4mruE",
|
|
174
|
+
description: "Empty state message when log streaming is not configured"
|
|
175
|
+
}
|
|
176
|
+
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
177
|
+
/* @__PURE__ */ jsx(IconPanel, { color: "panel", children: icon ? /* @__PURE__ */ jsx(ProviderIcon, { provider: icon, size: "2" }) : /* @__PURE__ */ jsx(GenericHttpsIcon, {}) }),
|
|
178
|
+
lastSyncedAt ? /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
179
|
+
/* @__PURE__ */ jsx(Text, { size: "2", weight: "bold", children: getDestinationName(destinationType) }),
|
|
180
|
+
/* @__PURE__ */ jsx(Text, { size: "2", color: "gray", children: /* @__PURE__ */ jsx(
|
|
181
|
+
Translation,
|
|
182
|
+
{
|
|
183
|
+
defaultMessage: "Last sync {relativeTime}",
|
|
184
|
+
id: "fT9f0p",
|
|
185
|
+
description: "Label showing when the last log stream sync occurred",
|
|
186
|
+
values: {
|
|
187
|
+
relativeTime: getRelativeTimeString(
|
|
188
|
+
/* @__PURE__ */ new Date(),
|
|
189
|
+
lastSyncedAt
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
) })
|
|
194
|
+
] }) : /* @__PURE__ */ jsx(Text, { size: "2", weight: "bold", children: getDestinationName(destinationType) })
|
|
195
|
+
] }) }),
|
|
196
|
+
/* @__PURE__ */ jsx(Flex, { gap: "5", align: "center", children: connectionStatus === "NotConfigured" ? adminPortalOpenButton : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
197
|
+
connectionStatus === "Inactive" && /* @__PURE__ */ jsx(Status, { state: "waiting", children: /* @__PURE__ */ jsx(
|
|
198
|
+
Translation,
|
|
199
|
+
{
|
|
200
|
+
defaultMessage: "Setup in progress",
|
|
201
|
+
id: "M6iKLG",
|
|
202
|
+
description: "Status when log stream setup is incomplete"
|
|
203
|
+
}
|
|
204
|
+
) }),
|
|
205
|
+
connectionStatus === "Active" && /* @__PURE__ */ jsx(Status, { state: "success", children: /* @__PURE__ */ jsx(
|
|
206
|
+
Translation,
|
|
207
|
+
{
|
|
208
|
+
defaultMessage: "Streaming",
|
|
209
|
+
id: "25L0J+",
|
|
210
|
+
description: "Status when log stream is active"
|
|
211
|
+
}
|
|
212
|
+
) }),
|
|
213
|
+
connectionStatus === "Error" && /* @__PURE__ */ jsx(Status, { state: "error", children: /* @__PURE__ */ jsx(
|
|
214
|
+
Translation,
|
|
215
|
+
{
|
|
216
|
+
defaultMessage: "Not streaming",
|
|
217
|
+
id: "7fAKZo",
|
|
218
|
+
description: "Status when log stream has an error"
|
|
219
|
+
}
|
|
220
|
+
) }),
|
|
221
|
+
adminPortalOpenButton
|
|
222
|
+
] }) })
|
|
223
|
+
] }) }),
|
|
224
|
+
connectionStatus === "Error" && /* @__PURE__ */ jsx(CardList.Item, { children: /* @__PURE__ */ jsxs(Flex, { align: "start", gap: "2", children: [
|
|
225
|
+
/* @__PURE__ */ jsx(Box, { asChild: true, mt: "2px", flexShrink: "0", children: /* @__PURE__ */ jsx(InfoCircledIcon, { color: "gray" }) }),
|
|
226
|
+
/* @__PURE__ */ jsx(Text, { size: "2", color: "gray", children: /* @__PURE__ */ jsx(
|
|
227
|
+
Translation,
|
|
228
|
+
{
|
|
229
|
+
defaultMessage: "The credentials provided are incorrect or missing. Please review and update your log stream configuration.",
|
|
230
|
+
id: "23tmgn",
|
|
231
|
+
description: "Error message shown when audit log stream has a configuration or delivery error"
|
|
232
|
+
}
|
|
233
|
+
) })
|
|
234
|
+
] }) })
|
|
235
|
+
] }) });
|
|
236
|
+
};
|
|
237
|
+
const AdminPortalAuditLogStreamingLoading = (props) => {
|
|
238
|
+
return /* @__PURE__ */ jsx(Card, { size: "2", ...getWidgetRootDomProps("loading", props), children: /* @__PURE__ */ jsxs(Flex, { direction: "row", justify: "between", align: "center", gap: "2", children: [
|
|
239
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "4", align: "center", children: [
|
|
240
|
+
/* @__PURE__ */ jsx(Skeleton, { children: /* @__PURE__ */ jsx(IconPanel, { color: "panel", children: /* @__PURE__ */ jsx(ProviderIcon, { provider: "datadog", size: "2" }) }) }),
|
|
241
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", my: "-4px", children: [
|
|
242
|
+
/* @__PURE__ */ jsx(Skeleton, { children: /* @__PURE__ */ jsx(Text, { size: "1", children: "Datadog" }) }),
|
|
243
|
+
/* @__PURE__ */ jsx(Skeleton, { children: /* @__PURE__ */ jsx(Text, { size: "1", children: "Last sync 10 minutes ago" }) })
|
|
244
|
+
] })
|
|
245
|
+
] }),
|
|
246
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "5", align: "center", children: [
|
|
247
|
+
/* @__PURE__ */ jsx(Skeleton, { children: /* @__PURE__ */ jsx(Status, { state: "success", children: "Streaming" }) }),
|
|
248
|
+
/* @__PURE__ */ jsx(Skeleton, { children: /* @__PURE__ */ jsxs(Button, { variant: "secondary", children: [
|
|
249
|
+
"Manage ",
|
|
250
|
+
/* @__PURE__ */ jsx(ExternalLinkIcon, { "aria-hidden": true })
|
|
251
|
+
] }) })
|
|
252
|
+
] })
|
|
253
|
+
] }) });
|
|
254
|
+
};
|
|
255
|
+
const AdminPortalAuditLogStreamingError = ({ error, ...domProps }) => {
|
|
256
|
+
React.useEffect(() => {
|
|
257
|
+
console.error(error);
|
|
258
|
+
}, [error]);
|
|
259
|
+
const translate = useTranslation();
|
|
260
|
+
const { heading, message } = getErrorMessage(error, translate);
|
|
261
|
+
return /* @__PURE__ */ jsx(Card, { size: "2", ...getWidgetRootDomProps("error", domProps), children: /* @__PURE__ */ jsx(Flex, { direction: "row", justify: "between", align: "center", gap: "2", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", align: "center", children: [
|
|
262
|
+
/* @__PURE__ */ jsx(
|
|
263
|
+
Flex,
|
|
264
|
+
{
|
|
265
|
+
align: "center",
|
|
266
|
+
justify: "center",
|
|
267
|
+
width: "24px",
|
|
268
|
+
height: "24px",
|
|
269
|
+
style: {
|
|
270
|
+
borderRadius: "9999px",
|
|
271
|
+
backgroundColor: "var(--red-a4)",
|
|
272
|
+
color: "var(--red-a11)",
|
|
273
|
+
flexShrink: 0
|
|
274
|
+
},
|
|
275
|
+
children: /* @__PURE__ */ jsx(Cross2Icon, { width: "18px", height: "18px" })
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
279
|
+
/* @__PURE__ */ jsx(Text, { size: "2", weight: "bold", children: heading }),
|
|
280
|
+
/* @__PURE__ */ jsx(Text, { size: "2", color: "gray", children: message })
|
|
281
|
+
] })
|
|
282
|
+
] }) }) });
|
|
283
|
+
};
|
|
284
|
+
export {
|
|
285
|
+
AdminPortalAuditLogStreaming,
|
|
286
|
+
AdminPortalAuditLogStreamingButton,
|
|
287
|
+
AdminPortalAuditLogStreamingError,
|
|
288
|
+
AdminPortalAuditLogStreamingLoading
|
|
289
|
+
};
|
|
290
|
+
//# sourceMappingURL=admin-portal-audit-log-streaming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/admin-portal-audit-log-streaming.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Box, Card, Flex, Text } from \"@radix-ui/themes\";\nimport * as CardList from \"./card-list.js\";\nimport { Button, Skeleton } from \"./elements.js\";\nimport {\n ExternalLinkIcon,\n Cross2Icon,\n InfoCircledIcon,\n} from \"@radix-ui/react-icons\";\nimport { ProviderIcon } from \"./provider-icon.js\";\nimport { IconPanel } from \"./icon-panel.js\";\nimport { GenericHttpsIcon } from \"./audit-log-stream-icons.js\";\nimport { Status } from \"./status.js\";\nimport {\n getDomProps,\n type WidgetRootState,\n type WidgetRootDomProps,\n} from \"./utils.js\";\nimport { Translation } from \"./i18n/translation.js\";\nimport { useTranslation } from \"./i18n/use-translation.js\";\nimport { getErrorMessage } from \"./generic-error.js\";\nimport type { AuditLogStreamType } from \"../api/endpoint.js\";\n\n// ============================================================================\n// TYPE DEFINITIONS\n// ============================================================================\n\ninterface NotConfiguredProps {\n connectionStatus: \"NotConfigured\";\n}\n\ninterface InactiveProps {\n connectionStatus: \"Inactive\";\n destinationType: AuditLogStreamType;\n}\n\ninterface ActiveProps {\n connectionStatus: \"Active\";\n destinationType: AuditLogStreamType;\n lastSyncedEventId?: string | null;\n}\n\ninterface ErrorProps {\n connectionStatus: \"Error\";\n destinationType: AuditLogStreamType;\n lastSyncedEventId?: string | null;\n}\n\nconst AdminPortalAuditLogStreamingContext = React.createContext<{\n connectionStatus: AdminPortalAuditLogStreamingStatusProps[\"connectionStatus\"];\n} | null>(null);\n\nfunction useAdminPortalAuditLogStreamingContext() {\n const context = React.useContext(AdminPortalAuditLogStreamingContext);\n if (!context) {\n throw new Error(\n \"useAdminPortalAuditLogStreamingContext must be used within a AdminPortalAuditLogStreamingContext provider\",\n );\n }\n return context;\n}\n\nexport type AdminPortalAuditLogStreamingStatusProps =\n | NotConfiguredProps\n | InactiveProps\n | ActiveProps\n | ErrorProps;\n\ntype AdminPortalAuditLogStreamingProps = WidgetRootDomProps &\n AdminPortalAuditLogStreamingStatusProps & {\n adminPortalOpenButton: React.ReactNode;\n };\n\n// ============================================================================\n// HELPER FUNCTIONS\n// ============================================================================\n\n/**\n * Maps AuditLogStreamType to display name\n */\nfunction getDestinationName(type: AuditLogStreamType): string {\n switch (type) {\n case \"Datadog\":\n return \"Datadog\";\n case \"Splunk\":\n return \"Splunk\";\n case \"S3\":\n return \"AWS S3\";\n case \"GoogleCloudStorage\":\n return \"Google Cloud Storage\";\n case \"AzureSentinel\":\n return \"Azure Sentinel\";\n case \"GenericHttps\":\n return \"Generic HTTPS\";\n default:\n return type;\n }\n}\n\n/**\n * Maps AuditLogStreamType to ProviderIcon provider name\n */\nfunction getDestinationIcon(\n type: AuditLogStreamType,\n): \"datadog\" | \"splunk\" | \"aws\" | \"google-cloud\" | \"azure\" | undefined {\n switch (type) {\n case \"Datadog\":\n return \"datadog\";\n case \"Splunk\":\n return \"splunk\";\n case \"S3\":\n return \"aws\";\n case \"GoogleCloudStorage\":\n return \"google-cloud\";\n case \"AzureSentinel\":\n return \"azure\";\n default:\n return undefined;\n }\n}\n\n/**\n * Helper to get the correct WidgetRootDomProps based on state\n */\nfunction getWidgetRootDomProps(\n state: WidgetRootState,\n domProps: WidgetRootDomProps,\n) {\n return getDomProps({\n ...domProps,\n isWidgetRoot: true,\n widgetId: \"admin-portal-audit-log-streaming\",\n widgetState: state,\n });\n}\n\nconst CROCKFORD_BASE32 = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\n\nfunction decodeUlidTimestamp(ulid: string): Date | null {\n if (!ulid || ulid.length < 10) return null;\n let timestamp = 0;\n for (let i = 0; i < 10; i++) {\n const charIndex = CROCKFORD_BASE32.indexOf(ulid.charAt(i).toUpperCase());\n if (charIndex === -1) return null;\n timestamp = timestamp * 32 + charIndex;\n }\n return new Date(timestamp);\n}\n\nfunction getRelativeTimeString(currentDate: Date, pastDate: Date): string {\n const rtf = new Intl.RelativeTimeFormat(\"en\", { numeric: \"auto\" });\n const diff = pastDate.getTime() - currentDate.getTime();\n const diffSeconds = Math.round(diff / 1000);\n const diffMinutes = Math.round(diffSeconds / 60);\n const diffHours = Math.round(diffMinutes / 60);\n const diffDays = Math.round(diffHours / 24);\n const diffMonths = Math.round(diffDays / 30);\n const diffYears = Math.round(diffMonths / 12);\n\n if (Math.abs(diffSeconds) < 60) return \"now\";\n if (Math.abs(diffMinutes) < 60) return rtf.format(diffMinutes, \"minute\");\n if (Math.abs(diffHours) < 24) return rtf.format(diffHours, \"hour\");\n if (Math.abs(diffDays) < 30) return rtf.format(diffDays, \"day\");\n if (Math.abs(diffMonths) < 12) return rtf.format(diffMonths, \"month\");\n return rtf.format(diffYears, \"year\");\n}\n\nfunction AdminPortalAuditLogStreamingButton({\n isPending,\n href,\n initConfig,\n}: {\n isPending: boolean;\n href: string | null;\n initConfig: () => void;\n}) {\n const { connectionStatus } = useAdminPortalAuditLogStreamingContext();\n const label = (() => {\n switch (connectionStatus) {\n case \"NotConfigured\":\n return (\n <Translation\n defaultMessage=\"Set up Log Streams\"\n id=\"s3Wu7U\"\n description=\"Button label to start log stream setup\"\n />\n );\n case \"Inactive\":\n return (\n <Translation\n defaultMessage=\"Continue setup\"\n id=\"/oM/HY\"\n description=\"Button label to continue incomplete log stream setup\"\n />\n );\n case \"Active\":\n case \"Error\":\n return (\n <Translation\n defaultMessage=\"Manage\"\n id=\"+k5uUi\"\n description=\"Button label to manage log stream settings\"\n />\n );\n }\n })();\n\n if (href) {\n return (\n <Button variant=\"secondary\" asChild>\n <a href={href} target=\"_blank\" rel=\"noopener noreferrer\">\n {label} <ExternalLinkIcon aria-hidden />\n </a>\n </Button>\n );\n }\n\n return (\n <Button\n variant=\"secondary\"\n loading={isPending}\n disabled={isPending}\n onClick={initConfig}\n >\n {label} <ExternalLinkIcon aria-hidden />\n </Button>\n );\n}\n\n// ============================================================================\n// MAIN COMPONENT\n// ============================================================================\n\nconst AdminPortalAuditLogStreaming: React.FC<\n AdminPortalAuditLogStreamingProps\n> = (props) => {\n const { connectionStatus, adminPortalOpenButton, className } = props;\n\n const destinationType =\n connectionStatus !== \"NotConfigured\"\n ? (props as InactiveProps | ActiveProps | ErrorProps).destinationType\n : null;\n const lastSyncedEventId =\n connectionStatus === \"Active\" || connectionStatus === \"Error\"\n ? (props as ActiveProps | ErrorProps).lastSyncedEventId\n : undefined;\n const lastSyncedAt = lastSyncedEventId\n ? decodeUlidTimestamp(lastSyncedEventId)\n : null;\n\n const icon = destinationType ? getDestinationIcon(destinationType) : null;\n\n return (\n <AdminPortalAuditLogStreamingContext.Provider value={{ connectionStatus }}>\n <CardList.Root {...getWidgetRootDomProps(\"resolved\", { className })}>\n <CardList.Item>\n <Flex direction=\"row\" justify=\"between\" align=\"center\" gap=\"2\">\n <Flex gap=\"4\" align=\"center\">\n {connectionStatus === \"NotConfigured\" ? (\n <Text size=\"2\" color=\"gray\">\n <Translation\n defaultMessage=\"You haven't set up Log Streams yet.\"\n id=\"n4mruE\"\n description=\"Empty state message when log streaming is not configured\"\n />\n </Text>\n ) : (\n <>\n <IconPanel color=\"panel\">\n {icon ? (\n <ProviderIcon provider={icon} size=\"2\" />\n ) : (\n <GenericHttpsIcon />\n )}\n </IconPanel>\n {lastSyncedAt ? (\n <Flex direction=\"column\">\n <Text size=\"2\" weight=\"bold\">\n {getDestinationName(destinationType!)}\n </Text>\n <Text size=\"2\" color=\"gray\">\n <Translation\n defaultMessage=\"Last sync {relativeTime}\"\n id=\"fT9f0p\"\n description=\"Label showing when the last log stream sync occurred\"\n values={{\n relativeTime: getRelativeTimeString(\n new Date(),\n lastSyncedAt,\n ),\n }}\n />\n </Text>\n </Flex>\n ) : (\n <Text size=\"2\" weight=\"bold\">\n {getDestinationName(destinationType!)}\n </Text>\n )}\n </>\n )}\n </Flex>\n\n <Flex gap=\"5\" align=\"center\">\n {connectionStatus === \"NotConfigured\" ? (\n adminPortalOpenButton\n ) : (\n <>\n {connectionStatus === \"Inactive\" && (\n <Status state=\"waiting\">\n <Translation\n defaultMessage=\"Setup in progress\"\n id=\"M6iKLG\"\n description=\"Status when log stream setup is incomplete\"\n />\n </Status>\n )}\n {connectionStatus === \"Active\" && (\n <Status state=\"success\">\n <Translation\n defaultMessage=\"Streaming\"\n id=\"25L0J+\"\n description=\"Status when log stream is active\"\n />\n </Status>\n )}\n {connectionStatus === \"Error\" && (\n <Status state=\"error\">\n <Translation\n defaultMessage=\"Not streaming\"\n id=\"7fAKZo\"\n description=\"Status when log stream has an error\"\n />\n </Status>\n )}\n {adminPortalOpenButton}\n </>\n )}\n </Flex>\n </Flex>\n </CardList.Item>\n\n {connectionStatus === \"Error\" && (\n <CardList.Item>\n <Flex align=\"start\" gap=\"2\">\n <Box asChild mt=\"2px\" flexShrink=\"0\">\n <InfoCircledIcon color=\"gray\" />\n </Box>\n <Text size=\"2\" color=\"gray\">\n <Translation\n defaultMessage=\"The credentials provided are incorrect or missing. Please review and update your log stream configuration.\"\n id=\"23tmgn\"\n description=\"Error message shown when audit log stream has a configuration or delivery error\"\n />\n </Text>\n </Flex>\n </CardList.Item>\n )}\n </CardList.Root>\n </AdminPortalAuditLogStreamingContext.Provider>\n );\n};\n\n// ============================================================================\n// LOADING COMPONENT\n// ============================================================================\n\ninterface AdminPortalAuditLogStreamingLoadingProps extends WidgetRootDomProps {}\n\nconst AdminPortalAuditLogStreamingLoading: React.FC<\n AdminPortalAuditLogStreamingLoadingProps\n> = (props) => {\n return (\n <Card size=\"2\" {...getWidgetRootDomProps(\"loading\", props)}>\n <Flex direction=\"row\" justify=\"between\" align=\"center\" gap=\"2\">\n <Flex gap=\"4\" align=\"center\">\n <Skeleton>\n <IconPanel color=\"panel\">\n <ProviderIcon provider=\"datadog\" size=\"2\" />\n </IconPanel>\n </Skeleton>\n <Flex direction=\"column\" gap=\"1\" my=\"-4px\">\n <Skeleton>\n {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}\n <Text size=\"1\">Datadog</Text>\n </Skeleton>\n <Skeleton>\n {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}\n <Text size=\"1\">Last sync 10 minutes ago</Text>\n </Skeleton>\n </Flex>\n </Flex>\n\n <Flex gap=\"5\" align=\"center\">\n <Skeleton>\n {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}\n <Status state=\"success\">Streaming</Status>\n </Skeleton>\n <Skeleton>\n {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}\n <Button variant=\"secondary\">\n Manage <ExternalLinkIcon aria-hidden />\n </Button>\n </Skeleton>\n </Flex>\n </Flex>\n </Card>\n );\n};\n\n// ============================================================================\n// ERROR COMPONENT\n// ============================================================================\n\ninterface AdminPortalAuditLogStreamingErrorProps extends WidgetRootDomProps {\n error: unknown;\n}\n\nconst AdminPortalAuditLogStreamingError: React.FC<\n AdminPortalAuditLogStreamingErrorProps\n> = ({ error, ...domProps }) => {\n React.useEffect(() => {\n console.error(error);\n }, [error]);\n\n const translate = useTranslation();\n const { heading, message } = getErrorMessage(error, translate);\n\n return (\n <Card size=\"2\" {...getWidgetRootDomProps(\"error\", domProps)}>\n <Flex direction=\"row\" justify=\"between\" align=\"center\" gap=\"2\">\n <Flex gap=\"4\" align=\"center\">\n {/* Error icon circle */}\n <Flex\n align=\"center\"\n justify=\"center\"\n width=\"24px\"\n height=\"24px\"\n style={{\n borderRadius: \"9999px\",\n backgroundColor: \"var(--red-a4)\",\n color: \"var(--red-a11)\",\n flexShrink: 0,\n }}\n >\n <Cross2Icon width=\"18px\" height=\"18px\" />\n </Flex>\n {/* Error text */}\n <Flex direction=\"column\">\n <Text size=\"2\" weight=\"bold\">\n {heading}\n </Text>\n <Text size=\"2\" color=\"gray\">\n {message}\n </Text>\n </Flex>\n </Flex>\n </Flex>\n </Card>\n );\n};\n\n// ============================================================================\n// EXPORTS\n// ============================================================================\n\nexport type {\n AdminPortalAuditLogStreamingProps,\n AdminPortalAuditLogStreamingLoadingProps,\n AdminPortalAuditLogStreamingErrorProps,\n};\n\nexport {\n AdminPortalAuditLogStreaming,\n AdminPortalAuditLogStreamingLoading,\n AdminPortalAuditLogStreamingError,\n /** @internal */\n AdminPortalAuditLogStreamingButton,\n};\n"],"mappings":";AAuLU,SAsFM,UAtFN,KA6BF,YA7BE;AArLV,YAAY,WAAW;AACvB,SAAS,KAAK,MAAM,MAAM,YAAY;AACtC,YAAY,cAAc;AAC1B,SAAS,QAAQ,gBAAgB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,S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,OAAO,SAAS;AAE7D,SACE,oBAAC,QAAK,MAAK,KAAK,GAAG,sBAAsB,SAAS,QAAQ,GACxD,8BAAC,QAAK,WAAU,OAAM,SAAQ,WAAU,OAAM,UAAS,KAAI,KACzD,+BAAC,QAAK,KAAI,KAAI,OAAM,UAElB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAM;AAAA,QACN,SAAQ;AAAA,QACR,OAAM;AAAA,QACN,QAAO;AAAA,QACP,OAAO;AAAA,UACL,cAAc;AAAA,UACd,iBAAiB;AAAA,UACjB,OAAO;AAAA,UACP,YAAY;AAAA,QACd;AAAA,QAEA,8BAAC,cAAW,OAAM,QAAO,QAAO,QAAO;AAAA;AAAA,IACzC;AAAA,IAEA,qBAAC,QAAK,WAAU,UACd;AAAA,0BAAC,QAAK,MAAK,KAAI,QAAO,QACnB,mBACH;AAAA,MACA,oBAAC,QAAK,MAAK,KAAI,OAAM,QAClB,mBACH;AAAA,OACF;AAAA,KACF,GACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function GenericHttpsIcon() {
|
|
3
|
+
return /* @__PURE__ */ jsxs(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
width: 16,
|
|
7
|
+
height: 16,
|
|
8
|
+
viewBox: "0 0 373.71 200",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
"path",
|
|
13
|
+
{
|
|
14
|
+
d: "M326 0H47.73L0 100l47.73 100H326l47.73-100Zm-15.95 183.36H58.22L18.43 100l39.79-83.36h251.83L349.84 100Z",
|
|
15
|
+
fill: "#008ec7"
|
|
16
|
+
}
|
|
17
|
+
),
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
"path",
|
|
20
|
+
{
|
|
21
|
+
d: "m349.84 100.01-39.79 83.36H58.22l-39.79-83.36 39.79-83.37h251.83l39.79 83.37z",
|
|
22
|
+
fill: "#005b9b"
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
"path",
|
|
27
|
+
{
|
|
28
|
+
d: "M128.05 71.89v59.53h-13.78V107h-27v24.41H73.46V71.89h13.77v23.47h27V71.89ZM154.5 83.12h-19.05V71.89h51.87v11.23h-19v48.3H154.5ZM207.9 83.12h-19.05V71.89h51.87v11.23h-19.05v48.3H207.9ZM287.62 74.53a20.45 20.45 0 0 1 9 7.48 20.67 20.67 0 0 1 3.14 11.48 20.73 20.73 0 0 1-3.14 11.44 20.06 20.06 0 0 1-9 7.48 33.55 33.55 0 0 1-13.74 2.59h-12v16.42h-13.76V71.89h25.76a33.05 33.05 0 0 1 13.74 2.64Zm-5.06 26.57a9.33 9.33 0 0 0 3.23-7.61c0-3.34-1.08-5.91-3.23-7.69s-5.3-2.68-9.44-2.68h-11.23v20.66h11.23q6.21 0 9.44-2.68Z",
|
|
29
|
+
fill: "#fff"
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
GenericHttpsIcon
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=audit-log-stream-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/audit-log-stream-icons.tsx"],"sourcesContent":["export function GenericHttpsIcon() {\n return (\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 373.71 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M326 0H47.73L0 100l47.73 100H326l47.73-100Zm-15.95 183.36H58.22L18.43 100l39.79-83.36h251.83L349.84 100Z\"\n fill=\"#008ec7\"\n />\n <path\n d=\"m349.84 100.01-39.79 83.36H58.22l-39.79-83.36 39.79-83.37h251.83l39.79 83.37z\"\n fill=\"#005b9b\"\n />\n <path\n d=\"M128.05 71.89v59.53h-13.78V107h-27v24.41H73.46V71.89h13.77v23.47h27V71.89ZM154.5 83.12h-19.05V71.89h51.87v11.23h-19v48.3H154.5ZM207.9 83.12h-19.05V71.89h51.87v11.23h-19.05v48.3H207.9ZM287.62 74.53a20.45 20.45 0 0 1 9 7.48 20.67 20.67 0 0 1 3.14 11.48 20.73 20.73 0 0 1-3.14 11.44 20.06 20.06 0 0 1-9 7.48 33.55 33.55 0 0 1-13.74 2.59h-12v16.42h-13.76V71.89h25.76a33.05 33.05 0 0 1 13.74 2.64Zm-5.06 26.57a9.33 9.33 0 0 0 3.23-7.61c0-3.34-1.08-5.91-3.23-7.69s-5.3-2.68-9.44-2.68h-11.23v20.66h11.23q6.21 0 9.44-2.68Z\"\n fill=\"#fff\"\n />\n </svg>\n );\n}\n"],"mappings":"AAEI,SAME,KANF;AAFG,SAAS,mBAAmB;AACjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAQ;AAAA,MACR,OAAM;AAAA,MAEN;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,GAAE;AAAA,YACF,MAAK;AAAA;AAAA,QACP;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,GAAE;AAAA,YACF,MAAK;AAAA;AAAA,QACP;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,GAAE;AAAA,YACF,MAAK;AAAA;AAAA,QACP;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare const IDENTITY_PROVIDER_DICT: Map<"asana" | "box" | "dropbox" | "github" | "gitlab" | "google" | "google-calendar" | "google-drive" | "hubspot" | "intercom" | "linear" | "microsoft" | "notion" | "salesforce" | "slack" | "stripe" | "xero" | "zendesk" | "bamboohr" | "hibob" | "personio" | "rippling" | "workday" | "azure" | "access-people-hr" | "adp" | "apple" | "auth0" | "aws" | "bamboo-hr" | "bitbucket" | "breathe-hr" | "bubble" | "cas" | "cezanne-hr" | "classlink" | "clerk" | "cloudflare" | "cyberark" | "datadog" | "duo" | "firebase" | "fourth" | "generic-saml" | "generic-oidc" | "godaddy" | "google-analytics" | "google-mail" | "google-cloud" | "intuit" | "jumpcloud" | "keycloak" | "lastpass" | "linkedin" | "login-gov" | "miniorange" | "net-iq" | "next-auth" | "okta" | "onelogin" | "oracle" | "ping-identity" | "react-native-expo" | "segment" | "shibboleth" | "simple-saml-php" | "splunk" | "supabase" | "vercel" | "vmware" | "workos" | "test-idp" | "discord" | "clever", "
|
|
1
|
+
declare const IDENTITY_PROVIDER_DICT: Map<"asana" | "box" | "dropbox" | "github" | "gitlab" | "google" | "google-calendar" | "google-drive" | "hubspot" | "intercom" | "linear" | "microsoft" | "notion" | "salesforce" | "slack" | "stripe" | "xero" | "zendesk" | "bamboohr" | "hibob" | "personio" | "rippling" | "workday" | "azure" | "access-people-hr" | "adp" | "apple" | "auth0" | "aws" | "bamboo-hr" | "bitbucket" | "breathe-hr" | "bubble" | "cas" | "cezanne-hr" | "classlink" | "clerk" | "cloudflare" | "cyberark" | "datadog" | "duo" | "firebase" | "fourth" | "generic-saml" | "generic-oidc" | "godaddy" | "google-analytics" | "google-mail" | "google-cloud" | "intuit" | "jumpcloud" | "keycloak" | "lastpass" | "linkedin" | "login-gov" | "miniorange" | "net-iq" | "next-auth" | "okta" | "onelogin" | "oracle" | "ping-identity" | "react-native-expo" | "segment" | "shibboleth" | "simple-saml-php" | "splunk" | "supabase" | "vercel" | "vmware" | "workos" | "test-idp" | "discord" | "clever", "Datadog" | "Splunk" | "GoDaddy" | "Access People HR" | "ADP" | "Apple" | "Asana" | "Auth0" | "Azure" | "AWS" | "BambooHR" | "Bitbucket" | "Box" | "BreatheHR" | "Bubble" | "CAS" | "Cezanne HR" | "Classlink" | "Clerk" | "Cloudflare" | "CyberArk" | "Dropbox" | "Duo" | "Firebase" | "Fourth" | "Generic SAML" | "Generic OIDC" | "GitHub" | "GitLab" | "Google" | "Google Analytics" | "Google Calendar" | "Google Drive" | "Google Mail" | "Google Cloud" | "HiBob" | "Hubspot" | "Intercom" | "Intuit" | "JumpCloud" | "Keycloak" | "LastPass" | "Linear" | "LinkedIn" | "Login.gov" | "Microsoft" | "Miniorange" | "NetIQ" | "NextAuth" | "Notion" | "Okta" | "OneLogin" | "Oracle" | "Personio" | "Ping Identity" | "React Native Expo" | "Rippling" | "Salesforce" | "Segment" | "Shibboleth" | "Simple SAML PHP" | "Slack" | "Stripe" | "Supabase" | "Vercel" | "VMware" | "Workday" | "WorkOS" | "Xero" | "Zendesk" | "Test IDP" | "Discord" | "Clever">;
|
|
2
2
|
type MapKey<T extends Map<unknown, unknown>> = T extends Map<infer K, unknown> ? K : never;
|
|
3
3
|
type IdentityProvider = MapKey<typeof IDENTITY_PROVIDER_DICT>;
|
|
4
|
-
declare function getIdentityProviderName(provider: IdentityProvider): "
|
|
4
|
+
declare function getIdentityProviderName(provider: IdentityProvider): "Datadog" | "Splunk" | "GoDaddy" | "Access People HR" | "ADP" | "Apple" | "Asana" | "Auth0" | "Azure" | "AWS" | "BambooHR" | "Bitbucket" | "Box" | "BreatheHR" | "Bubble" | "CAS" | "Cezanne HR" | "Classlink" | "Clerk" | "Cloudflare" | "CyberArk" | "Dropbox" | "Duo" | "Firebase" | "Fourth" | "Generic SAML" | "Generic OIDC" | "GitHub" | "GitLab" | "Google" | "Google Analytics" | "Google Calendar" | "Google Drive" | "Google Mail" | "Google Cloud" | "HiBob" | "Hubspot" | "Intercom" | "Intuit" | "JumpCloud" | "Keycloak" | "LastPass" | "Linear" | "LinkedIn" | "Login.gov" | "Microsoft" | "Miniorange" | "NetIQ" | "NextAuth" | "Notion" | "Okta" | "OneLogin" | "Oracle" | "Personio" | "Ping Identity" | "React Native Expo" | "Rippling" | "Salesforce" | "Segment" | "Shibboleth" | "Simple SAML PHP" | "Slack" | "Stripe" | "Supabase" | "Vercel" | "VMware" | "Workday" | "WorkOS" | "Xero" | "Zendesk" | "Test IDP" | "Discord" | "Clever" | undefined;
|
|
5
5
|
declare function getDirectoryTypeIcon(directoryType: string): IdentityProvider | null;
|
|
6
6
|
declare function getDirectoryTypeName(directoryType: string): string;
|
|
7
7
|
declare function isIdentityProvider(provider: unknown): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workos-inc/widgets",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"tsx": "^4.21.0",
|
|
96
96
|
"typescript": "^5.9.3",
|
|
97
97
|
"use-debounce": "^10.1.0",
|
|
98
|
-
"@repo/
|
|
99
|
-
"@repo/
|
|
98
|
+
"@repo/typescript-config": "0.0.0",
|
|
99
|
+
"@repo/eslint-config": "0.0.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependenciesMeta": {
|
|
102
102
|
"swr": {
|