@medusajs/admin-sdk 2.22.2 → 2.22.3-snapshot-20261103230838
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/AGENTS.md +1 -1
- package/README.md +1 -1
- package/dist/index.d.mts +13 -0
- package/dist/index.d.ts +13 -0
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ Config helpers that Medusa apps and plugins use to declare Admin customizations
|
|
|
7
7
|
Import directly from `@medusajs/admin-sdk`:
|
|
8
8
|
|
|
9
9
|
- `defineWidgetConfig({ zone, id? })`: widget in `src/admin/widgets/*.tsx`.
|
|
10
|
-
- `defineRouteConfig({ label?, icon?, nested?, rank?, translationNs? })`: UI route in `src/admin/routes/**/page.tsx`.
|
|
10
|
+
- `defineRouteConfig({ label?, icon?, nested?, rank?, translationNs?, permissions? })`: UI route in `src/admin/routes/**/page.tsx`. `permissions` (`resource:operation` keys, all required) guards the route and hides its sidebar item when RBAC is installed; child routes inherit it. Pages without a `config` (e.g. `@create` parallel routes) declare theirs with `export const handle = { permissions: [...] }`.
|
|
11
11
|
- `defineLayoutConfig({ id, sections })`: custom layout in `src/admin/layouts/`.
|
|
12
12
|
- `unstable_defineCustomFieldsConfig`, `unstable_createFormHelper`: experimental custom fields (product model only) in `src/admin/custom-fields/`.
|
|
13
13
|
- Types: `WidgetConfig`, `RouteConfig`, `LayoutConfig`.
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ Admin SDK for Medusa: helpers for configuring Medusa Admin dashboard extensions
|
|
|
47
47
|
## Features
|
|
48
48
|
|
|
49
49
|
- `defineWidgetConfig`: set the injection zone(s) a widget is shown in, with an optional stable `id`.
|
|
50
|
-
- `defineRouteConfig`: set a UI route's sidebar `label`, `icon`, `nested` position, `rank`, and `
|
|
50
|
+
- `defineRouteConfig`: set a UI route's sidebar `label`, `icon`, `nested` position, `rank`, `translationNs`, and the RBAC `permissions` required to open it.
|
|
51
51
|
- `defineLayoutConfig`: declare a custom layout's `id` and `sections`.
|
|
52
52
|
- Types: `WidgetConfig`, `RouteConfig`, `LayoutConfig`.
|
|
53
53
|
|
package/dist/index.d.mts
CHANGED
|
@@ -56,6 +56,19 @@ interface RouteConfig {
|
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
translationNs?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The RBAC permissions, as `resource:operation` keys, required to open the
|
|
61
|
+
* route. The user must hold all of them. Without them, the route renders an
|
|
62
|
+
* access denied page and its sidebar item is hidden. Child routes inherit
|
|
63
|
+
* the requirement unless they declare their own. Only enforced when the RBAC
|
|
64
|
+
* module is installed.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* permissions: ["gift_card:read"]
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
permissions?: string | string[];
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,19 @@ interface RouteConfig {
|
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
translationNs?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The RBAC permissions, as `resource:operation` keys, required to open the
|
|
61
|
+
* route. The user must hold all of them. Without them, the route renders an
|
|
62
|
+
* access denied page and its sidebar item is hidden. Child routes inherit
|
|
63
|
+
* the requirement unless they declare their own. Only enforced when the RBAC
|
|
64
|
+
* module is installed.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* permissions: ["gift_card:read"]
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
permissions?: string | string[];
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/admin-sdk",
|
|
3
3
|
"description": "SDK for building extension for the Medusa admin dashboard.",
|
|
4
|
-
"version": "2.22.
|
|
4
|
+
"version": "2.22.3-snapshot-20261103230838",
|
|
5
5
|
"author": "Kasper Kristensen <kasper@medusajs.com>",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"build": "yarn run -T tsup"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@medusajs/admin-shared": "2.22.
|
|
29
|
+
"@medusajs/admin-shared": "2.22.3-snapshot-20261103230838",
|
|
30
30
|
"zod": "4.6.6"
|
|
31
31
|
},
|
|
32
32
|
"packageManager": "yarn@3.2.1"
|