apiblaze 0.17.21 → 0.17.23
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/README.md +63 -0
- package/dist/index.js +451 -217
- package/dist/react/index.d.mts +67 -7
- package/dist/react/index.d.ts +67 -7
- package/dist/react/index.js +651 -69
- package/dist/react/index.mjs +651 -69
- package/dist/server/index.d.mts +165 -25
- package/dist/server/index.d.ts +165 -25
- package/dist/server/index.js +207 -35
- package/dist/server/index.mjs +204 -36
- package/package.json +28 -16
package/dist/react/index.d.mts
CHANGED
|
@@ -1,32 +1,92 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* apiblaze/react — <
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* apiblaze/react — <UsersGroupsWidget/>. Drop it into your site next to (or
|
|
5
|
+
* instead of) <ApiKeyWidget/>; it talks ONLY to your own backend route (which
|
|
6
|
+
* holds the same one CP widget key, mounted via createApiblazeGroups().handler).
|
|
7
|
+
*
|
|
8
|
+
* import { UsersGroupsWidget } from 'apiblaze/react';
|
|
9
|
+
* <UsersGroupsWidget theme={{ accent: '#e11d48' }} />
|
|
10
|
+
*
|
|
11
|
+
* Who sees what: apiblaze authorizes the LOGGED-IN USER server-side — only a
|
|
12
|
+
* tenant admin (an email on the tenant's admin-emails allowlist) can manage.
|
|
13
|
+
* Anyone else gets the "admin access pending" panel; nothing in this component
|
|
14
|
+
* (or your page) can elevate them.
|
|
15
|
+
*
|
|
16
|
+
* Default view = flat groups + members (the right ceiling for a handful of
|
|
17
|
+
* admins). Delegation (per-group admins) and nesting (subgroups) are there,
|
|
18
|
+
* one level down. Strictly users + groups — no authorization-rule authoring.
|
|
19
|
+
*
|
|
20
|
+
* `endpoint` defaults to /api/apiblaze/groups.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
type UsersGroupsWidgetTheme = ApiKeyWidgetTheme;
|
|
24
|
+
interface UsersGroupsWidgetProps {
|
|
25
|
+
endpoint?: string;
|
|
26
|
+
theme?: UsersGroupsWidgetTheme;
|
|
27
|
+
/** Heading text. Default "Users & groups". */
|
|
28
|
+
title?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
interface UsersGroupsWidgetHandle {
|
|
32
|
+
refresh: () => void;
|
|
33
|
+
}
|
|
34
|
+
declare const UsersGroupsWidget: React.ForwardRefExoticComponent<UsersGroupsWidgetProps & React.RefAttributes<UsersGroupsWidgetHandle>>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* apiblaze/react — <ApiKeyWidget/>. Drop it into your site (e.g. resiresi.com);
|
|
38
|
+
* it talks ONLY to your own backend route (which holds the CP key). Shows the
|
|
39
|
+
* logged-in user their API keys as a simple list with one always-visible
|
|
40
|
+
* "Create key" action, plus per-key show / rotate / revoke.
|
|
7
41
|
*
|
|
8
42
|
* import { ApiKeyWidget } from 'apiblaze/react';
|
|
9
43
|
* <ApiKeyWidget theme={{ accent: '#e11d48' }} />
|
|
10
44
|
*
|
|
45
|
+
* Fully white-labelable through `theme` alone — every font and color is a token,
|
|
46
|
+
* so you can match your brand (including a dark "codebox" look) without forking
|
|
47
|
+
* the component. See ApiKeyWidgetTheme.
|
|
48
|
+
*
|
|
11
49
|
* `endpoint` defaults to /api/apiblaze/keys (where you mounted createApiblazeKeys().handler).
|
|
12
50
|
*/
|
|
13
51
|
|
|
14
52
|
interface ApiKeyWidgetTheme {
|
|
53
|
+
/** Accent / primary action color. */
|
|
15
54
|
accent?: string;
|
|
55
|
+
/** Text/icon color ON accent buttons. Default #fff. */
|
|
56
|
+
accentText?: string;
|
|
57
|
+
/** Page color behind the card. Default transparent. */
|
|
16
58
|
background?: string;
|
|
59
|
+
/** Card body color. */
|
|
17
60
|
surface?: string;
|
|
61
|
+
/** Header strip color. Defaults to `surface` when unset. */
|
|
62
|
+
headerBackground?: string;
|
|
63
|
+
/** Primary text color. */
|
|
18
64
|
text?: string;
|
|
65
|
+
/** Secondary / muted text color. */
|
|
19
66
|
muted?: string;
|
|
67
|
+
/** Border + divider color. */
|
|
20
68
|
border?: string;
|
|
69
|
+
/** Destructive (revoke) color. */
|
|
70
|
+
danger?: string;
|
|
71
|
+
/** Positive (copied) color. */
|
|
72
|
+
success?: string;
|
|
73
|
+
/** Corner radius of the card, e.g. "12px". */
|
|
21
74
|
radius?: string;
|
|
75
|
+
/** Body font stack. */
|
|
76
|
+
fontFamily?: string;
|
|
77
|
+
/** Monospace font stack for keys and secrets. */
|
|
78
|
+
monoFontFamily?: string;
|
|
22
79
|
}
|
|
23
80
|
interface ApiKeyWidgetProps {
|
|
24
81
|
endpoint?: string;
|
|
25
82
|
theme?: ApiKeyWidgetTheme;
|
|
26
|
-
/**
|
|
27
|
-
|
|
83
|
+
/** Heading text. Default "Your API keys". */
|
|
84
|
+
title?: string;
|
|
28
85
|
className?: string;
|
|
29
86
|
}
|
|
30
|
-
|
|
87
|
+
interface ApiKeyWidgetHandle {
|
|
88
|
+
refresh: () => void;
|
|
89
|
+
}
|
|
90
|
+
declare const ApiKeyWidget: React.ForwardRefExoticComponent<ApiKeyWidgetProps & React.RefAttributes<ApiKeyWidgetHandle>>;
|
|
31
91
|
|
|
32
|
-
export { ApiKeyWidget, type ApiKeyWidgetProps, type ApiKeyWidgetTheme, ApiKeyWidget as default };
|
|
92
|
+
export { ApiKeyWidget, type ApiKeyWidgetHandle, type ApiKeyWidgetProps, type ApiKeyWidgetTheme, UsersGroupsWidget, type UsersGroupsWidgetHandle, type UsersGroupsWidgetProps, type UsersGroupsWidgetTheme, ApiKeyWidget as default };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,32 +1,92 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* apiblaze/react — <
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* apiblaze/react — <UsersGroupsWidget/>. Drop it into your site next to (or
|
|
5
|
+
* instead of) <ApiKeyWidget/>; it talks ONLY to your own backend route (which
|
|
6
|
+
* holds the same one CP widget key, mounted via createApiblazeGroups().handler).
|
|
7
|
+
*
|
|
8
|
+
* import { UsersGroupsWidget } from 'apiblaze/react';
|
|
9
|
+
* <UsersGroupsWidget theme={{ accent: '#e11d48' }} />
|
|
10
|
+
*
|
|
11
|
+
* Who sees what: apiblaze authorizes the LOGGED-IN USER server-side — only a
|
|
12
|
+
* tenant admin (an email on the tenant's admin-emails allowlist) can manage.
|
|
13
|
+
* Anyone else gets the "admin access pending" panel; nothing in this component
|
|
14
|
+
* (or your page) can elevate them.
|
|
15
|
+
*
|
|
16
|
+
* Default view = flat groups + members (the right ceiling for a handful of
|
|
17
|
+
* admins). Delegation (per-group admins) and nesting (subgroups) are there,
|
|
18
|
+
* one level down. Strictly users + groups — no authorization-rule authoring.
|
|
19
|
+
*
|
|
20
|
+
* `endpoint` defaults to /api/apiblaze/groups.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
type UsersGroupsWidgetTheme = ApiKeyWidgetTheme;
|
|
24
|
+
interface UsersGroupsWidgetProps {
|
|
25
|
+
endpoint?: string;
|
|
26
|
+
theme?: UsersGroupsWidgetTheme;
|
|
27
|
+
/** Heading text. Default "Users & groups". */
|
|
28
|
+
title?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
interface UsersGroupsWidgetHandle {
|
|
32
|
+
refresh: () => void;
|
|
33
|
+
}
|
|
34
|
+
declare const UsersGroupsWidget: React.ForwardRefExoticComponent<UsersGroupsWidgetProps & React.RefAttributes<UsersGroupsWidgetHandle>>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* apiblaze/react — <ApiKeyWidget/>. Drop it into your site (e.g. resiresi.com);
|
|
38
|
+
* it talks ONLY to your own backend route (which holds the CP key). Shows the
|
|
39
|
+
* logged-in user their API keys as a simple list with one always-visible
|
|
40
|
+
* "Create key" action, plus per-key show / rotate / revoke.
|
|
7
41
|
*
|
|
8
42
|
* import { ApiKeyWidget } from 'apiblaze/react';
|
|
9
43
|
* <ApiKeyWidget theme={{ accent: '#e11d48' }} />
|
|
10
44
|
*
|
|
45
|
+
* Fully white-labelable through `theme` alone — every font and color is a token,
|
|
46
|
+
* so you can match your brand (including a dark "codebox" look) without forking
|
|
47
|
+
* the component. See ApiKeyWidgetTheme.
|
|
48
|
+
*
|
|
11
49
|
* `endpoint` defaults to /api/apiblaze/keys (where you mounted createApiblazeKeys().handler).
|
|
12
50
|
*/
|
|
13
51
|
|
|
14
52
|
interface ApiKeyWidgetTheme {
|
|
53
|
+
/** Accent / primary action color. */
|
|
15
54
|
accent?: string;
|
|
55
|
+
/** Text/icon color ON accent buttons. Default #fff. */
|
|
56
|
+
accentText?: string;
|
|
57
|
+
/** Page color behind the card. Default transparent. */
|
|
16
58
|
background?: string;
|
|
59
|
+
/** Card body color. */
|
|
17
60
|
surface?: string;
|
|
61
|
+
/** Header strip color. Defaults to `surface` when unset. */
|
|
62
|
+
headerBackground?: string;
|
|
63
|
+
/** Primary text color. */
|
|
18
64
|
text?: string;
|
|
65
|
+
/** Secondary / muted text color. */
|
|
19
66
|
muted?: string;
|
|
67
|
+
/** Border + divider color. */
|
|
20
68
|
border?: string;
|
|
69
|
+
/** Destructive (revoke) color. */
|
|
70
|
+
danger?: string;
|
|
71
|
+
/** Positive (copied) color. */
|
|
72
|
+
success?: string;
|
|
73
|
+
/** Corner radius of the card, e.g. "12px". */
|
|
21
74
|
radius?: string;
|
|
75
|
+
/** Body font stack. */
|
|
76
|
+
fontFamily?: string;
|
|
77
|
+
/** Monospace font stack for keys and secrets. */
|
|
78
|
+
monoFontFamily?: string;
|
|
22
79
|
}
|
|
23
80
|
interface ApiKeyWidgetProps {
|
|
24
81
|
endpoint?: string;
|
|
25
82
|
theme?: ApiKeyWidgetTheme;
|
|
26
|
-
/**
|
|
27
|
-
|
|
83
|
+
/** Heading text. Default "Your API keys". */
|
|
84
|
+
title?: string;
|
|
28
85
|
className?: string;
|
|
29
86
|
}
|
|
30
|
-
|
|
87
|
+
interface ApiKeyWidgetHandle {
|
|
88
|
+
refresh: () => void;
|
|
89
|
+
}
|
|
90
|
+
declare const ApiKeyWidget: React.ForwardRefExoticComponent<ApiKeyWidgetProps & React.RefAttributes<ApiKeyWidgetHandle>>;
|
|
31
91
|
|
|
32
|
-
export { ApiKeyWidget, type ApiKeyWidgetProps, type ApiKeyWidgetTheme, ApiKeyWidget as default };
|
|
92
|
+
export { ApiKeyWidget, type ApiKeyWidgetHandle, type ApiKeyWidgetProps, type ApiKeyWidgetTheme, UsersGroupsWidget, type UsersGroupsWidgetHandle, type UsersGroupsWidgetProps, type UsersGroupsWidgetTheme, ApiKeyWidget as default };
|