@acmekit/dashboard 2.13.14 → 2.13.15
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/{api-key-management-create-VWUERPPB.mjs → api-key-management-create-4AG76FJV.mjs} +5 -5
- package/dist/{api-key-management-detail-V4ENQHYY.mjs → api-key-management-detail-T2TB4KST.mjs} +1 -1
- package/dist/{api-key-management-list-K2XPKF5E.mjs → api-key-management-list-HYZG23AG.mjs} +3 -3
- package/dist/app.js +21 -21
- package/dist/app.mjs +18 -18
- package/dist/{chunk-G22WWLPG.mjs → chunk-J6XIB6ZU.mjs} +3 -3
- package/dist/en.json +6 -6
- package/package.json +8 -8
- package/src/components/layout/settings-layout/settings-layout.tsx +2 -2
- package/src/components/search/constants.ts +1 -1
- package/src/dashboard-app/routes/get-route.map.tsx +2 -2
- package/src/i18n/translations/en.json +6 -6
- package/src/providers/keybind-provider/hooks.tsx +1 -1
- package/src/routes/api-key-management/api-key-management-create/components/api-key-create-form/api-key-create-form.tsx +6 -6
- package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-management-list-table.tsx +5 -5
- package/src/routes/api-key-management/common/constants.ts +1 -1
- package/src/routes/api-key-management/common/utils.ts +3 -3
- package/src/hooks/api/store.tsx +0 -75
package/dist/{api-key-management-create-VWUERPPB.mjs → api-key-management-create-4AG76FJV.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getApiKeyTypeFromPathname
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-J6XIB6ZU.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useCreateApiKey
|
|
6
6
|
} from "./chunk-EFRMWHRX.mjs";
|
|
@@ -61,8 +61,8 @@ var ApiKeyCreateForm = ({ keyType }) => {
|
|
|
61
61
|
onSuccess: ({ api_key }) => {
|
|
62
62
|
toast.success(t("apiKeyManagement.create.successToast"));
|
|
63
63
|
switch (keyType) {
|
|
64
|
-
case "
|
|
65
|
-
handleSuccess(`/settings/
|
|
64
|
+
case "client" /* CLIENT */:
|
|
65
|
+
handleSuccess(`/settings/client-api-keys/${api_key.id}`);
|
|
66
66
|
break;
|
|
67
67
|
case "secret" /* SECRET */:
|
|
68
68
|
setCreatedKey(api_key);
|
|
@@ -98,8 +98,8 @@ var ApiKeyCreateForm = ({ keyType }) => {
|
|
|
98
98
|
/* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
|
|
99
99
|
/* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8 px-2 py-16", children: [
|
|
100
100
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
101
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: keyType === "
|
|
102
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: keyType === "
|
|
101
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: keyType === "client" /* CLIENT */ ? t("apiKeyManagement.create.createClientHeader") : t("apiKeyManagement.create.createSecretHeader") }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: keyType === "client" /* CLIENT */ ? t("apiKeyManagement.create.createClientHint") : t("apiKeyManagement.create.createSecretHint") }) })
|
|
103
103
|
] }),
|
|
104
104
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsx(
|
|
105
105
|
Form.Field,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getApiKeyTypeFromPathname,
|
|
4
4
|
getApiKeyTypeProps,
|
|
5
5
|
prettifyRedactedToken
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J6XIB6ZU.mjs";
|
|
7
7
|
import {
|
|
8
8
|
StatusCell
|
|
9
9
|
} from "./chunk-WILMJYUB.mjs";
|
|
@@ -348,8 +348,8 @@ var ApiKeyManagementListTable = ({
|
|
|
348
348
|
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
349
349
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
350
350
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
351
|
-
/* @__PURE__ */ jsx6(Heading, { level: "h1", children: keyType === "
|
|
352
|
-
/* @__PURE__ */ jsx6(Text, { className: "text-ui-fg-subtle", size: "small", children: keyType === "
|
|
351
|
+
/* @__PURE__ */ jsx6(Heading, { level: "h1", children: keyType === "client" ? t(`apiKeyManagement.domain.client`) : t("apiKeyManagement.domain.secret") }),
|
|
352
|
+
/* @__PURE__ */ jsx6(Text, { className: "text-ui-fg-subtle", size: "small", children: keyType === "client" ? t(`apiKeyManagement.subtitle.client`) : t("apiKeyManagement.subtitle.secret") })
|
|
353
353
|
] }),
|
|
354
354
|
/* @__PURE__ */ jsx6(Link, { to: "create", children: /* @__PURE__ */ jsx6(Button, { variant: "secondary", size: "small", children: t("actions.create") }) })
|
|
355
355
|
] }),
|
package/dist/app.js
CHANGED
|
@@ -7205,7 +7205,7 @@ function getApiKeyTypeFromPathname(pathname) {
|
|
|
7205
7205
|
case true:
|
|
7206
7206
|
return "secret" /* SECRET */;
|
|
7207
7207
|
case false:
|
|
7208
|
-
return "
|
|
7208
|
+
return "client" /* CLIENT */;
|
|
7209
7209
|
}
|
|
7210
7210
|
}
|
|
7211
7211
|
function getApiKeyStatusProps(revokedAt, t3) {
|
|
@@ -7221,10 +7221,10 @@ function getApiKeyStatusProps(revokedAt, t3) {
|
|
|
7221
7221
|
};
|
|
7222
7222
|
}
|
|
7223
7223
|
function getApiKeyTypeProps(type, t3) {
|
|
7224
|
-
if (type === "
|
|
7224
|
+
if (type === "client" /* CLIENT */) {
|
|
7225
7225
|
return {
|
|
7226
7226
|
color: "green",
|
|
7227
|
-
label: t3("apiKeyManagement.type.
|
|
7227
|
+
label: t3("apiKeyManagement.type.client")
|
|
7228
7228
|
};
|
|
7229
7229
|
}
|
|
7230
7230
|
return {
|
|
@@ -7674,8 +7674,8 @@ var init_api_key_management_list_table = __esm({
|
|
|
7674
7674
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_ui58.Container, { className: "divide-y p-0", children: [
|
|
7675
7675
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
7676
7676
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { children: [
|
|
7677
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_ui58.Heading, { level: "h1", children: keyType === "
|
|
7678
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_ui58.Text, { className: "text-ui-fg-subtle", size: "small", children: keyType === "
|
|
7677
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_ui58.Heading, { level: "h1", children: keyType === "client" ? t3(`apiKeyManagement.domain.client`) : t3("apiKeyManagement.domain.secret") }),
|
|
7678
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_ui58.Text, { className: "text-ui-fg-subtle", size: "small", children: keyType === "client" ? t3(`apiKeyManagement.subtitle.client`) : t3("apiKeyManagement.subtitle.secret") })
|
|
7679
7679
|
] }),
|
|
7680
7680
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom34.Link, { to: "create", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_ui58.Button, { variant: "secondary", size: "small", children: t3("actions.create") }) })
|
|
7681
7681
|
] }),
|
|
@@ -7804,8 +7804,8 @@ var init_api_key_create_form = __esm({
|
|
|
7804
7804
|
onSuccess: ({ api_key }) => {
|
|
7805
7805
|
import_ui59.toast.success(t3("apiKeyManagement.create.successToast"));
|
|
7806
7806
|
switch (keyType) {
|
|
7807
|
-
case "
|
|
7808
|
-
handleSuccess(`/settings/
|
|
7807
|
+
case "client" /* CLIENT */:
|
|
7808
|
+
handleSuccess(`/settings/client-api-keys/${api_key.id}`);
|
|
7809
7809
|
break;
|
|
7810
7810
|
case "secret" /* SECRET */:
|
|
7811
7811
|
setCreatedKey(api_key);
|
|
@@ -7841,8 +7841,8 @@ var init_api_key_create_form = __esm({
|
|
|
7841
7841
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(RouteFocusModal.Header, {}),
|
|
7842
7842
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8 px-2 py-16", children: [
|
|
7843
7843
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
|
|
7844
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_ui59.Heading, { children: keyType === "
|
|
7845
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_ui59.Text, { size: "small", className: "text-ui-fg-subtle", children: keyType === "
|
|
7844
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_ui59.Heading, { children: keyType === "client" /* CLIENT */ ? t3("apiKeyManagement.create.createClientHeader") : t3("apiKeyManagement.create.createSecretHeader") }) }),
|
|
7845
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_ui59.Text, { size: "small", className: "text-ui-fg-subtle", children: keyType === "client" /* CLIENT */ ? t3("apiKeyManagement.create.createClientHint") : t3("apiKeyManagement.create.createSecretHint") }) })
|
|
7846
7846
|
] }),
|
|
7847
7847
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7848
7848
|
Form.Field,
|
|
@@ -26816,7 +26816,7 @@ var en_default = {
|
|
|
26816
26816
|
productTag: "Product Tags",
|
|
26817
26817
|
location: "Locations",
|
|
26818
26818
|
shippingProfile: "Shipping Profiles",
|
|
26819
|
-
|
|
26819
|
+
clientApiKey: "Client API Keys",
|
|
26820
26820
|
secretApiKey: "Secret API Keys",
|
|
26821
26821
|
command: "Commands",
|
|
26822
26822
|
navigation: "Navigation"
|
|
@@ -29386,11 +29386,11 @@ var en_default = {
|
|
|
29386
29386
|
},
|
|
29387
29387
|
apiKeyManagement: {
|
|
29388
29388
|
domain: {
|
|
29389
|
-
|
|
29389
|
+
client: "Client API Keys",
|
|
29390
29390
|
secret: "Secret API Keys"
|
|
29391
29391
|
},
|
|
29392
29392
|
subtitle: {
|
|
29393
|
-
|
|
29393
|
+
client: "Manage API keys for client and public API access.",
|
|
29394
29394
|
secret: "Manage API keys used to authenticate admin users in admin applications."
|
|
29395
29395
|
},
|
|
29396
29396
|
status: {
|
|
@@ -29398,12 +29398,12 @@ var en_default = {
|
|
|
29398
29398
|
revoked: "Revoked"
|
|
29399
29399
|
},
|
|
29400
29400
|
type: {
|
|
29401
|
-
|
|
29401
|
+
client: "Client",
|
|
29402
29402
|
secret: "Secret"
|
|
29403
29403
|
},
|
|
29404
29404
|
create: {
|
|
29405
|
-
|
|
29406
|
-
|
|
29405
|
+
createClientHeader: "Create Client API Key",
|
|
29406
|
+
createClientHint: "Create a new client API key for public or client application API access.",
|
|
29407
29407
|
createSecretHeader: "Create Secret API Key",
|
|
29408
29408
|
createSecretHint: "Create a new secret API key to access the AcmeKit API as an authenticated admin user.",
|
|
29409
29409
|
secretKeyCreatedHeader: "Secret Key Created",
|
|
@@ -110636,7 +110636,7 @@ var Thumbnail = ({ src, alt, size = "base" }) => {
|
|
|
110636
110636
|
var SEARCH_AREAS = [
|
|
110637
110637
|
"all",
|
|
110638
110638
|
"user",
|
|
110639
|
-
"
|
|
110639
|
+
"clientApiKey",
|
|
110640
110640
|
"secretApiKey",
|
|
110641
110641
|
"command",
|
|
110642
110642
|
"navigation"
|
|
@@ -110805,7 +110805,7 @@ var useGlobalShortcuts = () => {
|
|
|
110805
110805
|
},
|
|
110806
110806
|
label: t3("app.keyboardShortcuts.settings.goToPublishableApiKeys"),
|
|
110807
110807
|
type: "settingShortcut",
|
|
110808
|
-
to: "/settings/
|
|
110808
|
+
to: "/settings/client-api-keys"
|
|
110809
110809
|
},
|
|
110810
110810
|
{
|
|
110811
110811
|
keys: {
|
|
@@ -112766,8 +112766,8 @@ var useDeveloperRoutes = () => {
|
|
|
112766
112766
|
return (0, import_react27.useMemo)(
|
|
112767
112767
|
() => [
|
|
112768
112768
|
{
|
|
112769
|
-
label: t3("apiKeyManagement.domain.
|
|
112770
|
-
to: "/settings/
|
|
112769
|
+
label: t3("apiKeyManagement.domain.client"),
|
|
112770
|
+
to: "/settings/client-api-keys"
|
|
112771
112771
|
},
|
|
112772
112772
|
{
|
|
112773
112773
|
label: t3("apiKeyManagement.domain.secret"),
|
|
@@ -113002,9 +113002,9 @@ var defaultSettingsRouteChildren = [
|
|
|
113002
113002
|
]
|
|
113003
113003
|
},
|
|
113004
113004
|
{
|
|
113005
|
-
path: "
|
|
113005
|
+
path: "client-api-keys",
|
|
113006
113006
|
element: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react_router_dom54.Outlet, {}),
|
|
113007
|
-
handle: { breadcrumb: () => (0, import_i18next4.t)("apiKeyManagement.domain.
|
|
113007
|
+
handle: { breadcrumb: () => (0, import_i18next4.t)("apiKeyManagement.domain.client") },
|
|
113008
113008
|
children: [
|
|
113009
113009
|
{
|
|
113010
113010
|
path: "",
|
package/dist/app.mjs
CHANGED
|
@@ -9107,7 +9107,7 @@ var en_default = {
|
|
|
9107
9107
|
productTag: "Product Tags",
|
|
9108
9108
|
location: "Locations",
|
|
9109
9109
|
shippingProfile: "Shipping Profiles",
|
|
9110
|
-
|
|
9110
|
+
clientApiKey: "Client API Keys",
|
|
9111
9111
|
secretApiKey: "Secret API Keys",
|
|
9112
9112
|
command: "Commands",
|
|
9113
9113
|
navigation: "Navigation"
|
|
@@ -11677,11 +11677,11 @@ var en_default = {
|
|
|
11677
11677
|
},
|
|
11678
11678
|
apiKeyManagement: {
|
|
11679
11679
|
domain: {
|
|
11680
|
-
|
|
11680
|
+
client: "Client API Keys",
|
|
11681
11681
|
secret: "Secret API Keys"
|
|
11682
11682
|
},
|
|
11683
11683
|
subtitle: {
|
|
11684
|
-
|
|
11684
|
+
client: "Manage API keys for client and public API access.",
|
|
11685
11685
|
secret: "Manage API keys used to authenticate admin users in admin applications."
|
|
11686
11686
|
},
|
|
11687
11687
|
status: {
|
|
@@ -11689,12 +11689,12 @@ var en_default = {
|
|
|
11689
11689
|
revoked: "Revoked"
|
|
11690
11690
|
},
|
|
11691
11691
|
type: {
|
|
11692
|
-
|
|
11692
|
+
client: "Client",
|
|
11693
11693
|
secret: "Secret"
|
|
11694
11694
|
},
|
|
11695
11695
|
create: {
|
|
11696
|
-
|
|
11697
|
-
|
|
11696
|
+
createClientHeader: "Create Client API Key",
|
|
11697
|
+
createClientHint: "Create a new client API key for public or client application API access.",
|
|
11698
11698
|
createSecretHeader: "Create Secret API Key",
|
|
11699
11699
|
createSecretHint: "Create a new secret API key to access the AcmeKit API as an authenticated admin user.",
|
|
11700
11700
|
secretKeyCreatedHeader: "Secret Key Created",
|
|
@@ -92949,7 +92949,7 @@ var Thumbnail = ({ src, alt, size = "base" }) => {
|
|
|
92949
92949
|
var SEARCH_AREAS = [
|
|
92950
92950
|
"all",
|
|
92951
92951
|
"user",
|
|
92952
|
-
"
|
|
92952
|
+
"clientApiKey",
|
|
92953
92953
|
"secretApiKey",
|
|
92954
92954
|
"command",
|
|
92955
92955
|
"navigation"
|
|
@@ -93116,7 +93116,7 @@ var useGlobalShortcuts = () => {
|
|
|
93116
93116
|
},
|
|
93117
93117
|
label: t2("app.keyboardShortcuts.settings.goToPublishableApiKeys"),
|
|
93118
93118
|
type: "settingShortcut",
|
|
93119
|
-
to: "/settings/
|
|
93119
|
+
to: "/settings/client-api-keys"
|
|
93120
93120
|
},
|
|
93121
93121
|
{
|
|
93122
93122
|
keys: {
|
|
@@ -95101,8 +95101,8 @@ var useDeveloperRoutes = () => {
|
|
|
95101
95101
|
return useMemo5(
|
|
95102
95102
|
() => [
|
|
95103
95103
|
{
|
|
95104
|
-
label: t2("apiKeyManagement.domain.
|
|
95105
|
-
to: "/settings/
|
|
95104
|
+
label: t2("apiKeyManagement.domain.client"),
|
|
95105
|
+
to: "/settings/client-api-keys"
|
|
95106
95106
|
},
|
|
95107
95107
|
{
|
|
95108
95108
|
label: t2("apiKeyManagement.domain.secret"),
|
|
@@ -95336,9 +95336,9 @@ var defaultSettingsRouteChildren = [
|
|
|
95336
95336
|
]
|
|
95337
95337
|
},
|
|
95338
95338
|
{
|
|
95339
|
-
path: "
|
|
95339
|
+
path: "client-api-keys",
|
|
95340
95340
|
element: /* @__PURE__ */ jsx21(Outlet4, {}),
|
|
95341
|
-
handle: { breadcrumb: () => t("apiKeyManagement.domain.
|
|
95341
|
+
handle: { breadcrumb: () => t("apiKeyManagement.domain.client") },
|
|
95342
95342
|
children: [
|
|
95343
95343
|
{
|
|
95344
95344
|
path: "",
|
|
@@ -95346,11 +95346,11 @@ var defaultSettingsRouteChildren = [
|
|
|
95346
95346
|
children: [
|
|
95347
95347
|
{
|
|
95348
95348
|
path: "",
|
|
95349
|
-
lazy: () => import("./api-key-management-list-
|
|
95349
|
+
lazy: () => import("./api-key-management-list-HYZG23AG.mjs"),
|
|
95350
95350
|
children: [
|
|
95351
95351
|
{
|
|
95352
95352
|
path: "create",
|
|
95353
|
-
lazy: () => import("./api-key-management-create-
|
|
95353
|
+
lazy: () => import("./api-key-management-create-4AG76FJV.mjs")
|
|
95354
95354
|
}
|
|
95355
95355
|
]
|
|
95356
95356
|
}
|
|
@@ -95359,7 +95359,7 @@ var defaultSettingsRouteChildren = [
|
|
|
95359
95359
|
{
|
|
95360
95360
|
path: ":id",
|
|
95361
95361
|
lazy: async () => {
|
|
95362
|
-
const { Component, Breadcrumb, loader } = await import("./api-key-management-detail-
|
|
95362
|
+
const { Component, Breadcrumb, loader } = await import("./api-key-management-detail-T2TB4KST.mjs");
|
|
95363
95363
|
return {
|
|
95364
95364
|
Component,
|
|
95365
95365
|
loader,
|
|
@@ -95388,11 +95388,11 @@ var defaultSettingsRouteChildren = [
|
|
|
95388
95388
|
children: [
|
|
95389
95389
|
{
|
|
95390
95390
|
path: "",
|
|
95391
|
-
lazy: () => import("./api-key-management-list-
|
|
95391
|
+
lazy: () => import("./api-key-management-list-HYZG23AG.mjs"),
|
|
95392
95392
|
children: [
|
|
95393
95393
|
{
|
|
95394
95394
|
path: "create",
|
|
95395
|
-
lazy: () => import("./api-key-management-create-
|
|
95395
|
+
lazy: () => import("./api-key-management-create-4AG76FJV.mjs")
|
|
95396
95396
|
}
|
|
95397
95397
|
]
|
|
95398
95398
|
}
|
|
@@ -95401,7 +95401,7 @@ var defaultSettingsRouteChildren = [
|
|
|
95401
95401
|
{
|
|
95402
95402
|
path: ":id",
|
|
95403
95403
|
lazy: async () => {
|
|
95404
|
-
const { Component, Breadcrumb, loader } = await import("./api-key-management-detail-
|
|
95404
|
+
const { Component, Breadcrumb, loader } = await import("./api-key-management-detail-T2TB4KST.mjs");
|
|
95405
95405
|
return {
|
|
95406
95406
|
Component,
|
|
95407
95407
|
loader,
|
|
@@ -5,7 +5,7 @@ function getApiKeyTypeFromPathname(pathname) {
|
|
|
5
5
|
case true:
|
|
6
6
|
return "secret" /* SECRET */;
|
|
7
7
|
case false:
|
|
8
|
-
return "
|
|
8
|
+
return "client" /* CLIENT */;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
function getApiKeyStatusProps(revokedAt, t) {
|
|
@@ -21,10 +21,10 @@ function getApiKeyStatusProps(revokedAt, t) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
function getApiKeyTypeProps(type, t) {
|
|
24
|
-
if (type === "
|
|
24
|
+
if (type === "client" /* CLIENT */) {
|
|
25
25
|
return {
|
|
26
26
|
color: "green",
|
|
27
|
-
label: t("apiKeyManagement.type.
|
|
27
|
+
label: t("apiKeyManagement.type.client")
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
return {
|
package/dist/en.json
CHANGED
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"productTag": "Product Tags",
|
|
192
192
|
"location": "Locations",
|
|
193
193
|
"shippingProfile": "Shipping Profiles",
|
|
194
|
-
"
|
|
194
|
+
"clientApiKey": "Client API Keys",
|
|
195
195
|
"secretApiKey": "Secret API Keys",
|
|
196
196
|
"command": "Commands",
|
|
197
197
|
"navigation": "Navigation"
|
|
@@ -2761,11 +2761,11 @@
|
|
|
2761
2761
|
},
|
|
2762
2762
|
"apiKeyManagement": {
|
|
2763
2763
|
"domain": {
|
|
2764
|
-
"
|
|
2764
|
+
"client": "Client API Keys",
|
|
2765
2765
|
"secret": "Secret API Keys"
|
|
2766
2766
|
},
|
|
2767
2767
|
"subtitle": {
|
|
2768
|
-
"
|
|
2768
|
+
"client": "Manage API keys for client and public API access.",
|
|
2769
2769
|
"secret": "Manage API keys used to authenticate admin users in admin applications."
|
|
2770
2770
|
},
|
|
2771
2771
|
"status": {
|
|
@@ -2773,12 +2773,12 @@
|
|
|
2773
2773
|
"revoked": "Revoked"
|
|
2774
2774
|
},
|
|
2775
2775
|
"type": {
|
|
2776
|
-
"
|
|
2776
|
+
"client": "Client",
|
|
2777
2777
|
"secret": "Secret"
|
|
2778
2778
|
},
|
|
2779
2779
|
"create": {
|
|
2780
|
-
"
|
|
2781
|
-
"
|
|
2780
|
+
"createClientHeader": "Create Client API Key",
|
|
2781
|
+
"createClientHint": "Create a new client API key for public or client application API access.",
|
|
2782
2782
|
"createSecretHeader": "Create Secret API Key",
|
|
2783
2783
|
"createSecretHint": "Create a new secret API key to access the AcmeKit API as an authenticated admin user.",
|
|
2784
2784
|
"secretKeyCreatedHeader": "Secret Key Created",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acmekit/dashboard",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.15",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
|
|
6
6
|
"dev": "../../../node_modules/.bin/vite",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@acmekit/admin-shared": "2.13.
|
|
43
|
-
"@acmekit/icons": "2.13.
|
|
44
|
-
"@acmekit/js-sdk": "2.13.
|
|
42
|
+
"@acmekit/admin-shared": "2.13.15",
|
|
43
|
+
"@acmekit/icons": "2.13.15",
|
|
44
|
+
"@acmekit/js-sdk": "2.13.15",
|
|
45
45
|
"@acmekit/ui": "4.1.11",
|
|
46
46
|
"@ariakit/react": "^0.4.15",
|
|
47
47
|
"@babel/runtime": "^7.26.10",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"zod": "3.25.76"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@acmekit/admin-shared": "2.13.
|
|
84
|
-
"@acmekit/admin-vite-plugin": "2.13.
|
|
85
|
-
"@acmekit/types": "2.13.
|
|
86
|
-
"@acmekit/ui-preset": "2.13.
|
|
83
|
+
"@acmekit/admin-shared": "2.13.15",
|
|
84
|
+
"@acmekit/admin-vite-plugin": "2.13.15",
|
|
85
|
+
"@acmekit/types": "2.13.15",
|
|
86
|
+
"@acmekit/ui-preset": "2.13.15"
|
|
87
87
|
},
|
|
88
88
|
"packageManager": "yarn@3.2.1"
|
|
89
89
|
}
|
|
@@ -40,8 +40,8 @@ const useDeveloperRoutes = (): INavItem[] => {
|
|
|
40
40
|
return useMemo(
|
|
41
41
|
() => [
|
|
42
42
|
{
|
|
43
|
-
label: t("apiKeyManagement.domain.
|
|
44
|
-
to: "/settings/
|
|
43
|
+
label: t("apiKeyManagement.domain.client"),
|
|
44
|
+
to: "/settings/client-api-keys",
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
label: t("apiKeyManagement.domain.secret"),
|
|
@@ -75,9 +75,9 @@ const defaultSettingsRouteChildren: RouteObject[] = [
|
|
|
75
75
|
],
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
path: "
|
|
78
|
+
path: "client-api-keys",
|
|
79
79
|
element: <Outlet />,
|
|
80
|
-
handle: { breadcrumb: () => t("apiKeyManagement.domain.
|
|
80
|
+
handle: { breadcrumb: () => t("apiKeyManagement.domain.client") },
|
|
81
81
|
children: [
|
|
82
82
|
{
|
|
83
83
|
path: "",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"productTag": "Product Tags",
|
|
192
192
|
"location": "Locations",
|
|
193
193
|
"shippingProfile": "Shipping Profiles",
|
|
194
|
-
"
|
|
194
|
+
"clientApiKey": "Client API Keys",
|
|
195
195
|
"secretApiKey": "Secret API Keys",
|
|
196
196
|
"command": "Commands",
|
|
197
197
|
"navigation": "Navigation"
|
|
@@ -2761,11 +2761,11 @@
|
|
|
2761
2761
|
},
|
|
2762
2762
|
"apiKeyManagement": {
|
|
2763
2763
|
"domain": {
|
|
2764
|
-
"
|
|
2764
|
+
"client": "Client API Keys",
|
|
2765
2765
|
"secret": "Secret API Keys"
|
|
2766
2766
|
},
|
|
2767
2767
|
"subtitle": {
|
|
2768
|
-
"
|
|
2768
|
+
"client": "Manage API keys for client and public API access.",
|
|
2769
2769
|
"secret": "Manage API keys used to authenticate admin users in admin applications."
|
|
2770
2770
|
},
|
|
2771
2771
|
"status": {
|
|
@@ -2773,12 +2773,12 @@
|
|
|
2773
2773
|
"revoked": "Revoked"
|
|
2774
2774
|
},
|
|
2775
2775
|
"type": {
|
|
2776
|
-
"
|
|
2776
|
+
"client": "Client",
|
|
2777
2777
|
"secret": "Secret"
|
|
2778
2778
|
},
|
|
2779
2779
|
"create": {
|
|
2780
|
-
"
|
|
2781
|
-
"
|
|
2780
|
+
"createClientHeader": "Create Client API Key",
|
|
2781
|
+
"createClientHint": "Create a new client API key for public or client application API access.",
|
|
2782
2782
|
"createSecretHeader": "Create Secret API Key",
|
|
2783
2783
|
"createSecretHint": "Create a new secret API key to access the AcmeKit API as an authenticated admin user.",
|
|
2784
2784
|
"secretKeyCreatedHeader": "Secret Key Created",
|
|
@@ -133,7 +133,7 @@ export const useGlobalShortcuts = () => {
|
|
|
133
133
|
},
|
|
134
134
|
label: t("app.keyboardShortcuts.settings.goToPublishableApiKeys"),
|
|
135
135
|
type: "settingShortcut",
|
|
136
|
-
to: "/settings/
|
|
136
|
+
to: "/settings/client-api-keys",
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
keys: {
|
|
@@ -63,8 +63,8 @@ export const ApiKeyCreateForm = ({ keyType }: ApiKeyCreateFormProps) => {
|
|
|
63
63
|
toast.success(t("apiKeyManagement.create.successToast"))
|
|
64
64
|
|
|
65
65
|
switch (keyType) {
|
|
66
|
-
case ApiKeyType.
|
|
67
|
-
handleSuccess(`/settings/
|
|
66
|
+
case ApiKeyType.CLIENT:
|
|
67
|
+
handleSuccess(`/settings/client-api-keys/${api_key.id}`)
|
|
68
68
|
break
|
|
69
69
|
case ApiKeyType.SECRET:
|
|
70
70
|
setCreatedKey(api_key)
|
|
@@ -109,15 +109,15 @@ export const ApiKeyCreateForm = ({ keyType }: ApiKeyCreateFormProps) => {
|
|
|
109
109
|
<div>
|
|
110
110
|
<RouteFocusModal.Title asChild>
|
|
111
111
|
<Heading>
|
|
112
|
-
{keyType === ApiKeyType.
|
|
113
|
-
? t("apiKeyManagement.create.
|
|
112
|
+
{keyType === ApiKeyType.CLIENT
|
|
113
|
+
? t("apiKeyManagement.create.createClientHeader")
|
|
114
114
|
: t("apiKeyManagement.create.createSecretHeader")}
|
|
115
115
|
</Heading>
|
|
116
116
|
</RouteFocusModal.Title>
|
|
117
117
|
<RouteFocusModal.Description asChild>
|
|
118
118
|
<Text size="small" className="text-ui-fg-subtle">
|
|
119
|
-
{keyType === ApiKeyType.
|
|
120
|
-
? t("apiKeyManagement.create.
|
|
119
|
+
{keyType === ApiKeyType.CLIENT
|
|
120
|
+
? t("apiKeyManagement.create.createClientHint")
|
|
121
121
|
: t("apiKeyManagement.create.createSecretHint")}
|
|
122
122
|
</Text>
|
|
123
123
|
</RouteFocusModal.Description>
|
|
@@ -14,7 +14,7 @@ const PAGE_SIZE = 20
|
|
|
14
14
|
export const ApiKeyManagementListTable = ({
|
|
15
15
|
keyType,
|
|
16
16
|
}: {
|
|
17
|
-
keyType: "secret" | "
|
|
17
|
+
keyType: "secret" | "client"
|
|
18
18
|
}) => {
|
|
19
19
|
const { t } = useTranslation()
|
|
20
20
|
|
|
@@ -54,13 +54,13 @@ export const ApiKeyManagementListTable = ({
|
|
|
54
54
|
<div className="flex items-center justify-between px-6 py-4">
|
|
55
55
|
<div>
|
|
56
56
|
<Heading level="h1">
|
|
57
|
-
{keyType === "
|
|
58
|
-
? t(`apiKeyManagement.domain.
|
|
57
|
+
{keyType === "client"
|
|
58
|
+
? t(`apiKeyManagement.domain.client`)
|
|
59
59
|
: t("apiKeyManagement.domain.secret")}
|
|
60
60
|
</Heading>
|
|
61
61
|
<Text className="text-ui-fg-subtle" size="small">
|
|
62
|
-
{keyType === "
|
|
63
|
-
? t(`apiKeyManagement.subtitle.
|
|
62
|
+
{keyType === "client"
|
|
63
|
+
? t(`apiKeyManagement.subtitle.client`)
|
|
64
64
|
: t("apiKeyManagement.subtitle.secret")}
|
|
65
65
|
</Text>
|
|
66
66
|
</div>
|
|
@@ -9,7 +9,7 @@ export function getApiKeyTypeFromPathname(pathname: string) {
|
|
|
9
9
|
case true:
|
|
10
10
|
return ApiKeyType.SECRET
|
|
11
11
|
case false:
|
|
12
|
-
return ApiKeyType.
|
|
12
|
+
return ApiKeyType.CLIENT
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -34,10 +34,10 @@ export function getApiKeyTypeProps(
|
|
|
34
34
|
type: AdminApiKeyResponse["api_key"]["type"],
|
|
35
35
|
t: TFunction
|
|
36
36
|
): { color: "green" | "blue"; label: string } {
|
|
37
|
-
if (type === ApiKeyType.
|
|
37
|
+
if (type === ApiKeyType.CLIENT) {
|
|
38
38
|
return {
|
|
39
39
|
color: "green",
|
|
40
|
-
label: t("apiKeyManagement.type.
|
|
40
|
+
label: t("apiKeyManagement.type.client"),
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
package/src/hooks/api/store.tsx
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MutationOptions,
|
|
3
|
-
QueryKey,
|
|
4
|
-
UseQueryOptions,
|
|
5
|
-
useMutation,
|
|
6
|
-
useQuery,
|
|
7
|
-
} from "@tanstack/react-query"
|
|
8
|
-
|
|
9
|
-
import { FetchError } from "@acmekit/js-sdk"
|
|
10
|
-
import { HttpTypes } from "@acmekit/types"
|
|
11
|
-
import { sdk } from "../../lib/client"
|
|
12
|
-
import { queryClient } from "../../lib/query-client"
|
|
13
|
-
import { queryKeysFactory } from "../../lib/query-key-factory"
|
|
14
|
-
|
|
15
|
-
const STORE_QUERY_KEY = "store" as const
|
|
16
|
-
export const storeQueryKeys = queryKeysFactory(STORE_QUERY_KEY)
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Workaround to keep the V1 version of retrieving the store.
|
|
20
|
-
*/
|
|
21
|
-
export async function retrieveActiveStore(
|
|
22
|
-
query?: HttpTypes.AdminStoreParams
|
|
23
|
-
): Promise<HttpTypes.AdminStoreResponse> {
|
|
24
|
-
const response = await sdk.admin.store.list(query)
|
|
25
|
-
|
|
26
|
-
const activeStore = response.stores?.[0]
|
|
27
|
-
|
|
28
|
-
if (!activeStore) {
|
|
29
|
-
throw new FetchError("No active store found", "Not Found", 404)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return { store: activeStore }
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const useStore = (
|
|
36
|
-
query?: HttpTypes.SelectParams,
|
|
37
|
-
options?: Omit<
|
|
38
|
-
UseQueryOptions<
|
|
39
|
-
HttpTypes.AdminStoreResponse,
|
|
40
|
-
FetchError,
|
|
41
|
-
HttpTypes.AdminStoreResponse,
|
|
42
|
-
QueryKey
|
|
43
|
-
>,
|
|
44
|
-
"queryFn" | "queryKey"
|
|
45
|
-
>
|
|
46
|
-
) => {
|
|
47
|
-
const { data, ...rest } = useQuery({
|
|
48
|
-
queryFn: () => retrieveActiveStore(query),
|
|
49
|
-
queryKey: storeQueryKeys.details(),
|
|
50
|
-
...options,
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
...data,
|
|
55
|
-
...rest,
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const useUpdateStore = (
|
|
60
|
-
id: string,
|
|
61
|
-
options?: MutationOptions<
|
|
62
|
-
HttpTypes.AdminStoreResponse,
|
|
63
|
-
FetchError,
|
|
64
|
-
HttpTypes.AdminUpdateStore
|
|
65
|
-
>
|
|
66
|
-
) => {
|
|
67
|
-
return useMutation({
|
|
68
|
-
mutationFn: (payload) => sdk.admin.store.update(id, payload),
|
|
69
|
-
onSuccess: (data, variables, context) => {
|
|
70
|
-
queryClient.invalidateQueries({ queryKey: storeQueryKeys.details() })
|
|
71
|
-
options?.onSuccess?.(data, variables, context)
|
|
72
|
-
},
|
|
73
|
-
...options,
|
|
74
|
-
})
|
|
75
|
-
}
|