@adobe-commerce/aio-experience-kit 1.0.0 → 1.0.1
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 +41 -0
- package/README.md +284 -19
- package/dist/cjs/components/DataForm/FieldBuilder/index.js +180 -35
- package/dist/cjs/components/DataForm/FieldBuilder/index.js.map +1 -1
- package/dist/cjs/components/DataForm/FormBuilder/index.js +9 -7
- package/dist/cjs/components/DataForm/FormBuilder/index.js.map +1 -1
- package/dist/cjs/components/DataForm/FormBuilder/types.js +2 -0
- package/dist/cjs/components/DataForm/FormBuilder/types.js.map +1 -1
- package/dist/cjs/components/DataForm/index.js +4 -1
- package/dist/cjs/components/DataForm/index.js.map +1 -1
- package/dist/cjs/components/DataTable/index.js +4 -1
- package/dist/cjs/components/DataTable/index.js.map +1 -1
- package/dist/cjs/components/ShippingCarrierForm/index.js +137 -0
- package/dist/cjs/components/ShippingCarrierForm/index.js.map +1 -0
- package/dist/cjs/index.js +6 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/AdminUiSdk/index.js +171 -66
- package/dist/cjs/utils/AdminUiSdk/index.js.map +1 -1
- package/dist/esm/components/DataForm/FieldBuilder/index.js +181 -36
- package/dist/esm/components/DataForm/FieldBuilder/index.js.map +1 -1
- package/dist/esm/components/DataForm/FormBuilder/index.js +9 -7
- package/dist/esm/components/DataForm/FormBuilder/index.js.map +1 -1
- package/dist/esm/components/DataForm/FormBuilder/types.js +2 -0
- package/dist/esm/components/DataForm/FormBuilder/types.js.map +1 -1
- package/dist/esm/components/DataForm/index.js +5 -2
- package/dist/esm/components/DataForm/index.js.map +1 -1
- package/dist/esm/components/DataTable/index.js +5 -2
- package/dist/esm/components/DataTable/index.js.map +1 -1
- package/dist/esm/components/ShippingCarrierForm/index.js +133 -0
- package/dist/esm/components/ShippingCarrierForm/index.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/DataForm/FieldBuilder/index.d.ts.map +1 -1
- package/dist/esm/types/components/DataForm/FormBuilder/index.d.ts.map +1 -1
- package/dist/esm/types/components/DataForm/FormBuilder/types.d.ts +2 -0
- package/dist/esm/types/components/DataForm/FormBuilder/types.d.ts.map +1 -1
- package/dist/esm/types/components/DataForm/index.d.ts.map +1 -1
- package/dist/esm/types/components/DataTable/index.d.ts.map +1 -1
- package/dist/esm/types/components/ShippingCarrierForm/index.d.ts +12 -0
- package/dist/esm/types/components/ShippingCarrierForm/index.d.ts.map +1 -0
- package/dist/esm/types/components/ShippingCarrierForm/types.d.ts +50 -0
- package/dist/esm/types/components/ShippingCarrierForm/types.d.ts.map +1 -0
- package/dist/esm/types/components/index.d.ts +2 -0
- package/dist/esm/types/components/index.d.ts.map +1 -1
- package/dist/esm/types/utils/AdminUiSdk/index.d.ts +48 -22
- package/dist/esm/types/utils/AdminUiSdk/index.d.ts.map +1 -1
- package/dist/esm/types/utils/AdminUiSdk/types.d.ts +28 -23
- package/dist/esm/types/utils/AdminUiSdk/types.d.ts.map +1 -1
- package/dist/esm/utils/AdminUiSdk/index.js +172 -67
- package/dist/esm/utils/AdminUiSdk/index.js.map +1 -1
- package/package.json +36 -35
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import { createClass as _createClass, toConsumableArray as _toConsumableArray, asyncToGenerator as _asyncToGenerator, regenerator as _regenerator, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import { register } from '@adobe/uix-guest';
|
|
2
|
+
import { attach, register } from '@adobe/uix-guest';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* AdminUiSdk - Utility for managing Adobe Admin UI extension
|
|
5
|
+
* AdminUiSdk - Utility for managing Adobe Admin UI extension registrations
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* const
|
|
10
|
-
* const sdk = new AdminUiSdk(extensionId);
|
|
9
|
+
* const sdk = new AdminUiSdk('admin_ui_extensibility');
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* title: 'Punchout Integrations 123',
|
|
15
|
-
* parent: 'Magento_Backend::content_elements',
|
|
16
|
-
* sortOrder: 1
|
|
17
|
-
* });
|
|
11
|
+
* // Add a menu section (ID will be prefixed automatically: 'admin_ui_extensibility::apps')
|
|
12
|
+
* sdk.addMenuSection('apps', 'Apps', 100);
|
|
18
13
|
*
|
|
19
|
-
*
|
|
14
|
+
* // Add a menu item (ID and parent will be prefixed automatically)
|
|
15
|
+
* sdk.addMenuItem('first', 'First App on App Builder', 1, 'apps');
|
|
20
16
|
*
|
|
21
|
-
*
|
|
17
|
+
* // Add page configuration
|
|
18
|
+
* sdk.addPage('Adobe Commerce First App on App Builder');
|
|
19
|
+
*
|
|
20
|
+
* // Get registration object
|
|
21
|
+
* const registration = sdk.getRegistration();
|
|
22
|
+
*
|
|
23
|
+
* // Register with Adobe UIX
|
|
24
|
+
* await sdk.registerExtension();
|
|
22
25
|
* ```
|
|
23
26
|
*/
|
|
24
27
|
var AdminUiSdk = /*#__PURE__*/function () {
|
|
@@ -34,43 +37,109 @@ var AdminUiSdk = /*#__PURE__*/function () {
|
|
|
34
37
|
if (!(extensionId !== null && extensionId !== void 0 && extensionId.trim())) {
|
|
35
38
|
throw new Error('Extension ID is required and cannot be empty');
|
|
36
39
|
}
|
|
37
|
-
|
|
40
|
+
var trimmedId = extensionId.trim();
|
|
41
|
+
if (!this.isValidId(trimmedId)) {
|
|
42
|
+
throw new Error('Extension ID must be alphanumeric with underscores only (no spaces, hyphens, or special characters)');
|
|
43
|
+
}
|
|
44
|
+
this.extensionId = trimmedId;
|
|
38
45
|
}
|
|
39
46
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param
|
|
42
|
-
* @
|
|
47
|
+
* Validates that an ID contains only alphanumeric characters and underscores
|
|
48
|
+
* @param id - The ID to validate
|
|
49
|
+
* @returns true if valid, false otherwise
|
|
43
50
|
*/
|
|
44
51
|
return _createClass(AdminUiSdk, [{
|
|
45
|
-
key: "
|
|
46
|
-
value: function
|
|
47
|
-
|
|
52
|
+
key: "isValidId",
|
|
53
|
+
value: function isValidId(id) {
|
|
54
|
+
return /^[a-zA-Z0-9_]+$/.test(id);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Adds a menu item to the extension
|
|
58
|
+
* @param id - Unique identifier for the menu item (will be prefixed with extensionId)
|
|
59
|
+
* @param title - Display title for the menu item
|
|
60
|
+
* @param sortOrder - Sort order for menu positioning
|
|
61
|
+
* @param parent - Parent menu identifier (optional, will be prefixed with extensionId if provided)
|
|
62
|
+
* @throws {Error} If parameters are invalid or ID already exists
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "addMenuItem",
|
|
66
|
+
value: function addMenuItem(id, title, sortOrder, parent) {
|
|
48
67
|
// Validation
|
|
49
|
-
if (!(
|
|
68
|
+
if (!(id !== null && id !== void 0 && id.trim())) {
|
|
50
69
|
throw new Error('Menu item ID is required and cannot be empty');
|
|
51
70
|
}
|
|
52
|
-
if (!(
|
|
71
|
+
if (!this.isValidId(id.trim())) {
|
|
72
|
+
throw new Error('Menu item ID must be alphanumeric with underscores only (no spaces, hyphens, or special characters)');
|
|
73
|
+
}
|
|
74
|
+
if (!(title !== null && title !== void 0 && title.trim())) {
|
|
53
75
|
throw new Error('Menu item title is required and cannot be empty');
|
|
54
76
|
}
|
|
55
|
-
if (
|
|
56
|
-
throw new Error('Menu item parent
|
|
77
|
+
if (parent !== undefined && !(parent !== null && parent !== void 0 && parent.trim())) {
|
|
78
|
+
throw new Error('Menu item parent cannot be empty if provided');
|
|
79
|
+
}
|
|
80
|
+
if (parent !== undefined && !this.isValidId(parent.trim())) {
|
|
81
|
+
throw new Error('Menu item parent must be alphanumeric with underscores only (no spaces, hyphens, or special characters)');
|
|
57
82
|
}
|
|
58
|
-
if (typeof
|
|
83
|
+
if (typeof sortOrder !== 'number' || sortOrder < 0) {
|
|
59
84
|
throw new Error('Menu item sortOrder must be a non-negative number');
|
|
60
85
|
}
|
|
86
|
+
// Create full ID with extension prefix
|
|
87
|
+
var fullId = "".concat(this.extensionId, "::").concat(id.trim());
|
|
61
88
|
// Check for duplicate IDs
|
|
62
|
-
var trimmedId = menuItem.id.trim();
|
|
63
89
|
if (this.menuItems.some(function (item) {
|
|
64
|
-
return item.id ===
|
|
90
|
+
return item.id === fullId;
|
|
65
91
|
})) {
|
|
66
|
-
throw new Error("Menu item with ID '".concat(
|
|
92
|
+
throw new Error("Menu item with ID '".concat(fullId, "' already exists"));
|
|
93
|
+
}
|
|
94
|
+
// Build menu item object - only include parent if provided
|
|
95
|
+
var menuItem = {
|
|
96
|
+
id: fullId,
|
|
97
|
+
title: title.trim(),
|
|
98
|
+
sortOrder: sortOrder
|
|
99
|
+
};
|
|
100
|
+
if (parent !== null && parent !== void 0 && parent.trim()) {
|
|
101
|
+
menuItem.parent = "".concat(this.extensionId, "::").concat(parent.trim());
|
|
67
102
|
}
|
|
68
103
|
// Add sanitized menu item
|
|
104
|
+
this.menuItems.push(menuItem);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Adds a menu section to the extension
|
|
108
|
+
* @param id - Unique identifier for the menu section (will be prefixed with extensionId)
|
|
109
|
+
* @param title - Display title for the menu section
|
|
110
|
+
* @param sortOrder - Sort order for section positioning
|
|
111
|
+
* @throws {Error} If parameters are invalid or ID already exists
|
|
112
|
+
*/
|
|
113
|
+
}, {
|
|
114
|
+
key: "addMenuSection",
|
|
115
|
+
value: function addMenuSection(id, title, sortOrder) {
|
|
116
|
+
// Validation
|
|
117
|
+
if (!(id !== null && id !== void 0 && id.trim())) {
|
|
118
|
+
throw new Error('Menu section ID is required and cannot be empty');
|
|
119
|
+
}
|
|
120
|
+
if (!this.isValidId(id.trim())) {
|
|
121
|
+
throw new Error('Menu section ID must be alphanumeric with underscores only (no spaces, hyphens, or special characters)');
|
|
122
|
+
}
|
|
123
|
+
if (!(title !== null && title !== void 0 && title.trim())) {
|
|
124
|
+
throw new Error('Menu section title is required and cannot be empty');
|
|
125
|
+
}
|
|
126
|
+
if (typeof sortOrder !== 'number' || sortOrder < 0) {
|
|
127
|
+
throw new Error('Menu section sortOrder must be a non-negative number');
|
|
128
|
+
}
|
|
129
|
+
// Create full ID with extension prefix
|
|
130
|
+
var fullId = "".concat(this.extensionId, "::").concat(id.trim());
|
|
131
|
+
// Check for duplicate IDs
|
|
132
|
+
if (this.menuItems.some(function (item) {
|
|
133
|
+
return item.id === fullId;
|
|
134
|
+
})) {
|
|
135
|
+
throw new Error("Menu item with ID '".concat(fullId, "' already exists"));
|
|
136
|
+
}
|
|
137
|
+
// Add sanitized menu section with isSection: true
|
|
69
138
|
this.menuItems.push({
|
|
70
|
-
id:
|
|
71
|
-
title:
|
|
72
|
-
|
|
73
|
-
|
|
139
|
+
id: fullId,
|
|
140
|
+
title: title.trim(),
|
|
141
|
+
sortOrder: sortOrder,
|
|
142
|
+
isSection: true
|
|
74
143
|
});
|
|
75
144
|
}
|
|
76
145
|
/**
|
|
@@ -87,67 +156,103 @@ var AdminUiSdk = /*#__PURE__*/function () {
|
|
|
87
156
|
this.pageTitle = title.trim();
|
|
88
157
|
}
|
|
89
158
|
/**
|
|
90
|
-
*
|
|
91
|
-
* @
|
|
159
|
+
* Gets the complete registration object for the extension
|
|
160
|
+
* @returns The registration object with optional menu items and page configuration
|
|
92
161
|
*/
|
|
93
162
|
}, {
|
|
94
|
-
key: "
|
|
163
|
+
key: "getRegistration",
|
|
164
|
+
value: function getRegistration() {
|
|
165
|
+
var registration = {};
|
|
166
|
+
// Only include menuItems if there are any
|
|
167
|
+
if (this.menuItems.length > 0) {
|
|
168
|
+
registration.menuItems = _toConsumableArray(this.menuItems); // Return copy to prevent mutation
|
|
169
|
+
}
|
|
170
|
+
// Only include page if title is set
|
|
171
|
+
if (this.pageTitle) {
|
|
172
|
+
registration.page = {
|
|
173
|
+
title: this.pageTitle
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
registration: registration
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Gets IMS credentials from Adobe UIX shared context
|
|
182
|
+
* @returns Promise resolving to credentials object with imsToken and imsOrgId
|
|
183
|
+
* @throws {Error} If credentials retrieval fails
|
|
184
|
+
*/
|
|
185
|
+
}, {
|
|
186
|
+
key: "getCredentials",
|
|
95
187
|
value: (function () {
|
|
96
|
-
var
|
|
97
|
-
var
|
|
188
|
+
var _getCredentials = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
189
|
+
var _guestConnection$shar, _guestConnection$shar2, guestConnection, imsToken, imsOrgId, _t;
|
|
98
190
|
return _regenerator().w(function (_context) {
|
|
99
191
|
while (1) switch (_context.p = _context.n) {
|
|
100
192
|
case 0:
|
|
101
193
|
_context.p = 0;
|
|
102
|
-
config = this.getConfig();
|
|
103
194
|
_context.n = 1;
|
|
104
|
-
return
|
|
195
|
+
return attach({
|
|
196
|
+
id: this.extensionId
|
|
197
|
+
});
|
|
105
198
|
case 1:
|
|
106
|
-
|
|
107
|
-
|
|
199
|
+
guestConnection = _context.v;
|
|
200
|
+
imsToken = (guestConnection === null || guestConnection === void 0 || (_guestConnection$shar = guestConnection.sharedContext) === null || _guestConnection$shar === void 0 ? void 0 : _guestConnection$shar.get('imsToken')) || null;
|
|
201
|
+
imsOrgId = (guestConnection === null || guestConnection === void 0 || (_guestConnection$shar2 = guestConnection.sharedContext) === null || _guestConnection$shar2 === void 0 ? void 0 : _guestConnection$shar2.get('imsOrgId')) || null;
|
|
202
|
+
return _context.a(2, {
|
|
203
|
+
imsToken: imsToken,
|
|
204
|
+
imsOrgId: imsOrgId
|
|
205
|
+
});
|
|
108
206
|
case 2:
|
|
109
207
|
_context.p = 2;
|
|
110
208
|
_t = _context.v;
|
|
111
|
-
throw new Error("Failed to
|
|
209
|
+
throw new Error("Failed to get credentials for extension '".concat(this.extensionId, "': ").concat(_t instanceof Error ? _t.message : 'Unknown error'));
|
|
112
210
|
case 3:
|
|
113
211
|
return _context.a(2);
|
|
114
212
|
}
|
|
115
213
|
}, _callee, this, [[0, 2]]);
|
|
116
214
|
}));
|
|
117
|
-
function
|
|
118
|
-
return
|
|
215
|
+
function getCredentials() {
|
|
216
|
+
return _getCredentials.apply(this, arguments);
|
|
119
217
|
}
|
|
120
|
-
return
|
|
218
|
+
return getCredentials;
|
|
121
219
|
}()
|
|
122
220
|
/**
|
|
123
|
-
*
|
|
124
|
-
* @
|
|
221
|
+
* Registers the extension with Adobe UIX
|
|
222
|
+
* @throws {Error} If registration fails
|
|
125
223
|
*/
|
|
126
224
|
)
|
|
127
225
|
}, {
|
|
128
|
-
key: "
|
|
129
|
-
value: function
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
226
|
+
key: "registerExtension",
|
|
227
|
+
value: (function () {
|
|
228
|
+
var _registerExtension = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
229
|
+
var _t2;
|
|
230
|
+
return _regenerator().w(function (_context2) {
|
|
231
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
232
|
+
case 0:
|
|
233
|
+
_context2.p = 0;
|
|
234
|
+
_context2.n = 1;
|
|
235
|
+
return register({
|
|
236
|
+
id: this.extensionId,
|
|
237
|
+
methods: {}
|
|
238
|
+
});
|
|
239
|
+
case 1:
|
|
240
|
+
_context2.n = 3;
|
|
241
|
+
break;
|
|
242
|
+
case 2:
|
|
243
|
+
_context2.p = 2;
|
|
244
|
+
_t2 = _context2.v;
|
|
245
|
+
throw new Error("Failed to register extension '".concat(this.extensionId, "': ").concat(_t2 instanceof Error ? _t2.message : 'Unknown error'));
|
|
246
|
+
case 3:
|
|
247
|
+
return _context2.a(2);
|
|
143
248
|
}
|
|
144
|
-
};
|
|
249
|
+
}, _callee2, this, [[0, 2]]);
|
|
250
|
+
}));
|
|
251
|
+
function registerExtension() {
|
|
252
|
+
return _registerExtension.apply(this, arguments);
|
|
145
253
|
}
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
methods: methods
|
|
149
|
-
};
|
|
150
|
-
}
|
|
254
|
+
return registerExtension;
|
|
255
|
+
}())
|
|
151
256
|
}]);
|
|
152
257
|
}();
|
|
153
258
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/utils/AdminUiSdk/index.ts"],"sourcesContent":["/**\n * <license header>\n */\n\nimport { register } from '@adobe/uix-guest';\nimport { MenuItem, AdminUiSdkConfig, AdminUiSdkInterface } from './types';\n\n/**\n * AdminUiSdk - Utility for managing Adobe Admin UI extension configurations\n *\n * @example\n * ```typescript\n * const extensionId = 'admin_ui_extensibility';\n * const sdk = new AdminUiSdk(extensionId);\n *\n * sdk.addMenu({\n * id: `${extensionId}::punchout_integrations`,\n * title: 'Punchout Integrations 123',\n * parent: 'Magento_Backend::content_elements',\n * sortOrder: 1\n * });\n *\n * sdk.addPage('Punchout Integration');\n *\n * await sdk.register(); // Register with Adobe UIX\n * ```\n */\nclass AdminUiSdk implements AdminUiSdkInterface {\n private readonly extensionId: string;\n private readonly menuItems: MenuItem[] = [];\n private pageTitle: string | null = null;\n\n /**\n * Creates a new AdminUiSdk instance\n * @param extensionId - Unique identifier for the extension\n * @throws {Error} If extensionId is empty or invalid\n */\n constructor(extensionId: string) {\n if (!extensionId?.trim()) {\n throw new Error('Extension ID is required and cannot be empty');\n }\n this.extensionId = extensionId.trim();\n }\n\n /**\n * Adds a menu item to the extension\n * @param menuItem - The menu item configuration\n * @throws {Error} If menuItem is invalid or ID already exists\n */\n addMenu(menuItem: MenuItem): void {\n // Validation\n if (!menuItem.id?.trim()) {\n throw new Error('Menu item ID is required and cannot be empty');\n }\n if (!menuItem.title?.trim()) {\n throw new Error('Menu item title is required and cannot be empty');\n }\n if (!menuItem.parent?.trim()) {\n throw new Error('Menu item parent is required and cannot be empty');\n }\n if (typeof menuItem.sortOrder !== 'number' || menuItem.sortOrder < 0) {\n throw new Error('Menu item sortOrder must be a non-negative number');\n }\n\n // Check for duplicate IDs\n const trimmedId = menuItem.id.trim();\n if (this.menuItems.some(item => item.id === trimmedId)) {\n throw new Error(`Menu item with ID '${trimmedId}' already exists`);\n }\n\n // Add sanitized menu item\n this.menuItems.push({\n id: trimmedId,\n title: menuItem.title.trim(),\n parent: menuItem.parent.trim(),\n sortOrder: menuItem.sortOrder,\n });\n }\n\n /**\n * Sets the page title for the extension\n * @param title - The page title\n * @throws {Error} If title is empty or invalid\n */\n addPage(title: string): void {\n if (!title?.trim()) {\n throw new Error('Page title is required and cannot be empty');\n }\n this.pageTitle = title.trim();\n }\n\n /**\n * Registers the extension with Adobe UIX\n * @throws {Error} If registration fails\n */\n async register(): Promise<void> {\n try {\n const config = this.getConfig();\n await register(config as any); // Type assertion for Adobe UIX compatibility\n } catch (error) {\n throw new Error(\n `Failed to register extension '${this.extensionId}': ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n }\n\n /**\n * Gets the complete configuration object for the extension (private method)\n * @returns The configuration object with extension ID and available methods\n */\n private getConfig(): AdminUiSdkConfig {\n const methods: AdminUiSdkConfig['methods'] = {};\n\n if (this.menuItems.length > 0) {\n methods.menu = {\n getItems: (): MenuItem[] => [...this.menuItems], // Return copy to prevent mutation\n };\n }\n\n if (this.pageTitle) {\n methods.page = {\n getTitle: (): string => this.pageTitle!,\n };\n }\n\n return {\n id: this.extensionId,\n methods,\n };\n }\n}\n\nexport default AdminUiSdk;\n\n// Re-export types for external use\nexport type {\n MenuItem,\n PageConfig,\n MenuMethods,\n PageMethods,\n AdminUiSdkConfig,\n AdminUiSdkInterface,\n} from './types';\n"],"names":["AdminUiSdk","extensionId","_classCallCheck","menuItems","pageTitle","trim","Error","_createClass","key","value","addMenu","menuItem","_menuItem$id","_menuItem$title","_menuItem$parent","id","title","parent","sortOrder","trimmedId","some","item","concat","push","addPage","_register2","_asyncToGenerator","_regenerator","m","_callee","config","_t","w","_context","p","n","getConfig","register","v","message","a","apply","arguments","_this","methods","length","menu","getItems","_toConsumableArray","page","getTitle"],"mappings":";;;AAOA;;;;;;;;;;;;;;;;;;;AAmBG;AAnBH,IAoBMA,UAAU,gBAAA,YAAA;AAKd;;;;AAIG;EACH,SAAAA,UAAAA,CAAYC,WAAmB,EAAA;AAAAC,IAAAA,eAAA,OAAAF,UAAA,CAAA;IARd,IAAA,CAAAG,SAAS,GAAe,EAAE;IACnC,IAAA,CAAAC,SAAS,GAAkB,IAAI;IAQrC,IAAI,EAACH,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAA,MAAA,IAAXA,WAAW,CAAEI,IAAI,EAAE,CAAA,EAAE;AACxB,MAAA,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;AACjE,IAAA;AACA,IAAA,IAAI,CAACL,WAAW,GAAGA,WAAW,CAACI,IAAI,EAAE;AACvC,EAAA;AAEA;;;;AAIG;EAJH,OAAAE,YAAA,CAAAP,UAAA,EAAA,CAAA;IAAAQ,GAAA,EAAA,SAAA;AAAAC,IAAAA,KAAA,EAKA,SAAAC,OAAOA,CAACC,QAAkB,EAAA;AAAA,MAAA,IAAAC,YAAA,EAAAC,eAAA,EAAAC,gBAAA;AACxB;AACA,MAAA,IAAI,EAAA,CAAAF,YAAA,GAACD,QAAQ,CAACI,EAAE,MAAA,IAAA,IAAAH,YAAA,KAAA,MAAA,IAAXA,YAAA,CAAaP,IAAI,EAAE,CAAA,EAAE;AACxB,QAAA,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;AACjE,MAAA;AACA,MAAA,IAAI,EAAA,CAAAO,eAAA,GAACF,QAAQ,CAACK,KAAK,MAAA,IAAA,IAAAH,eAAA,KAAA,MAAA,IAAdA,eAAA,CAAgBR,IAA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;AAAA;AAAA,QAAA,CAAA,EAAAX,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;MAAA,CAEJ,CAAA,CAAA;AAAA,MAAA,SATKQ,UAAQA,GAAA;AAAA,QAAA,OAAAZ,UAAA,CAAAgB,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA;AAAA,MAAA;AAAA,MAAA,OAARL,UAAQ;AAAA,IAAA,CAAA;AAWd;;;AAGG;AAHH;AAAA,GAAA,EAAA;IAAA7B,GAAA,EAAA,WAAA;AAAAC,IAAAA,KAAA,EAIQ,SAAA2B,SAASA,GAAA;AAAA,MAAA,IAAAO,KAAA,GAAA,IAAA;MACf,IAAMC,OAAO,GAAgC,EAAE;AAE/C,MAAA,IAAI,IAAI,CAACzC,SAAS,CAAC0C,MAAM,GAAG,CAAC,EAAE;QAC7BD,OAAO,CAACE,IAAI,GAAG;UACbC,QAAQ,EAAE,SAAVA,QAAQA,GAAA;AAAA,YAAA,OAAAC,kBAAA,CAAwBL,KAAI,CAACxC,SAAS,CAAA;AAAA,UAAA,CAAC;SAChD;AACH,MAAA;MAEA,IAAI,IAAI,CAACC,SAAS,EAAE;QAClBwC,OAAO,CAACK,IAAI,GAAG;UACbC,QAAQ,EAAE,SAAVA,QAAQA,GAAA;YAAA,OAAgBP,KAAI,CAACvC,SAAU;AAAA,UAAA;SACxC;AACH,MAAA;MAEA,OAAO;QACLW,EAAE,EAAE,IAAI,CAACd,WAAW;AACpB2C,QAAAA,OAAO,EAAPA;OACD;AACH,IAAA;AAAC,GAAA,CAAA,CAAA;AAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/utils/AdminUiSdk/index.ts"],"sourcesContent":["/**\n * <license header>\n */\n\nimport { register, attach } from '@adobe/uix-guest';\nimport {\n MenuItem,\n AdminUiSdkRegistration,\n AdminUiSdkInterface,\n AdminUiSdkCredentials,\n} from './types';\n\n/**\n * AdminUiSdk - Utility for managing Adobe Admin UI extension registrations\n *\n * @example\n * ```typescript\n * const sdk = new AdminUiSdk('admin_ui_extensibility');\n *\n * // Add a menu section (ID will be prefixed automatically: 'admin_ui_extensibility::apps')\n * sdk.addMenuSection('apps', 'Apps', 100);\n *\n * // Add a menu item (ID and parent will be prefixed automatically)\n * sdk.addMenuItem('first', 'First App on App Builder', 1, 'apps');\n *\n * // Add page configuration\n * sdk.addPage('Adobe Commerce First App on App Builder');\n *\n * // Get registration object\n * const registration = sdk.getRegistration();\n *\n * // Register with Adobe UIX\n * await sdk.registerExtension();\n * ```\n */\nclass AdminUiSdk implements AdminUiSdkInterface {\n private readonly extensionId: string;\n private readonly menuItems: MenuItem[] = [];\n private pageTitle: string | null = null;\n\n /**\n * Creates a new AdminUiSdk instance\n * @param extensionId - Unique identifier for the extension\n * @throws {Error} If extensionId is empty or invalid\n */\n constructor(extensionId: string) {\n if (!extensionId?.trim()) {\n throw new Error('Extension ID is required and cannot be empty');\n }\n\n const trimmedId = extensionId.trim();\n if (!this.isValidId(trimmedId)) {\n throw new Error(\n 'Extension ID must be alphanumeric with underscores only (no spaces, hyphens, or special characters)'\n );\n }\n\n this.extensionId = trimmedId;\n }\n\n /**\n * Validates that an ID contains only alphanumeric characters and underscores\n * @param id - The ID to validate\n * @returns true if valid, false otherwise\n */\n private isValidId(id: string): boolean {\n return /^[a-zA-Z0-9_]+$/.test(id);\n }\n\n /**\n * Adds a menu item to the extension\n * @param id - Unique identifier for the menu item (will be prefixed with extensionId)\n * @param title - Display title for the menu item\n * @param sortOrder - Sort order for menu positioning\n * @param parent - Parent menu identifier (optional, will be prefixed with extensionId if provided)\n * @throws {Error} If parameters are invalid or ID already exists\n */\n addMenuItem(id: string, title: string, sortOrder: number, parent?: string): void {\n // Validation\n if (!id?.trim()) {\n throw new Error('Menu item ID is required and cannot be empty');\n }\n if (!this.isValidId(id.trim())) {\n throw new Error(\n 'Menu item ID must be alphanumeric with underscores only (no spaces, hyphens, or special characters)'\n );\n }\n if (!title?.trim()) {\n throw new Error('Menu item title is required and cannot be empty');\n }\n if (parent !== undefined && !parent?.trim()) {\n throw new Error('Menu item parent cannot be empty if provided');\n }\n if (parent !== undefined && !this.isValidId(parent.trim())) {\n throw new Error(\n 'Menu item parent must be alphanumeric with underscores only (no spaces, hyphens, or special characters)'\n );\n }\n if (typeof sortOrder !== 'number' || sortOrder < 0) {\n throw new Error('Menu item sortOrder must be a non-negative number');\n }\n\n // Create full ID with extension prefix\n const fullId = `${this.extensionId}::${id.trim()}`;\n\n // Check for duplicate IDs\n if (this.menuItems.some(item => item.id === fullId)) {\n throw new Error(`Menu item with ID '${fullId}' already exists`);\n }\n\n // Build menu item object - only include parent if provided\n const menuItem: MenuItem = {\n id: fullId,\n title: title.trim(),\n sortOrder,\n };\n\n if (parent?.trim()) {\n menuItem.parent = `${this.extensionId}::${parent.trim()}`;\n }\n\n // Add sanitized menu item\n this.menuItems.push(menuItem);\n }\n\n /**\n * Adds a menu section to the extension\n * @param id - Unique identifier for the menu section (will be prefixed with extensionId)\n * @param title - Display title for the menu section\n * @param sortOrder - Sort order for section positioning\n * @throws {Error} If parameters are invalid or ID already exists\n */\n addMenuSection(id: string, title: string, sortOrder: number): void {\n // Validation\n if (!id?.trim()) {\n throw new Error('Menu section ID is required and cannot be empty');\n }\n if (!this.isValidId(id.trim())) {\n throw new Error(\n 'Menu section ID must be alphanumeric with underscores only (no spaces, hyphens, or special characters)'\n );\n }\n if (!title?.trim()) {\n throw new Error('Menu section title is required and cannot be empty');\n }\n if (typeof sortOrder !== 'number' || sortOrder < 0) {\n throw new Error('Menu section sortOrder must be a non-negative number');\n }\n\n // Create full ID with extension prefix\n const fullId = `${this.extensionId}::${id.trim()}`;\n\n // Check for duplicate IDs\n if (this.menuItems.some(item => item.id === fullId)) {\n throw new Error(`Menu item with ID '${fullId}' already exists`);\n }\n\n // Add sanitized menu section with isSection: true\n this.menuItems.push({\n id: fullId,\n title: title.trim(),\n sortOrder,\n isSection: true,\n });\n }\n\n /**\n * Sets the page title for the extension\n * @param title - The page title\n * @throws {Error} If title is empty or invalid\n */\n addPage(title: string): void {\n if (!title?.trim()) {\n throw new Error('Page title is required and cannot be empty');\n }\n this.pageTitle = title.trim();\n }\n\n /**\n * Gets the complete registration object for the extension\n * @returns The registration object with optional menu items and page configuration\n */\n getRegistration(): AdminUiSdkRegistration {\n const registration: any = {};\n\n // Only include menuItems if there are any\n if (this.menuItems.length > 0) {\n registration.menuItems = [...this.menuItems]; // Return copy to prevent mutation\n }\n\n // Only include page if title is set\n if (this.pageTitle) {\n registration.page = {\n title: this.pageTitle,\n };\n }\n\n return {\n registration,\n };\n }\n\n /**\n * Gets IMS credentials from Adobe UIX shared context\n * @returns Promise resolving to credentials object with imsToken and imsOrgId\n * @throws {Error} If credentials retrieval fails\n */\n async getCredentials(): Promise<AdminUiSdkCredentials> {\n try {\n const guestConnection = await attach({ id: this.extensionId });\n const imsToken = guestConnection?.sharedContext?.get('imsToken') || null;\n const imsOrgId = guestConnection?.sharedContext?.get('imsOrgId') || null;\n\n return {\n imsToken,\n imsOrgId,\n };\n } catch (error) {\n throw new Error(\n `Failed to get credentials for extension '${this.extensionId}': ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n }\n\n /**\n * Registers the extension with Adobe UIX\n * @throws {Error} If registration fails\n */\n async registerExtension(): Promise<void> {\n try {\n await register({\n id: this.extensionId,\n methods: {},\n });\n } catch (error) {\n throw new Error(\n `Failed to register extension '${this.extensionId}': ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n }\n}\n\nexport default AdminUiSdk;\n\n// Re-export types for external use\nexport type {\n MenuItem,\n PageConfig,\n Registration,\n AdminUiSdkRegistration,\n AdminUiSdkInterface,\n AdminUiSdkCredentials,\n} from './types';\n"],"names":["AdminUiSdk","extensionId","_classCallCheck","menuItems","pageTitle","trim","Error","trimmedId","isValidId","_createClass","key","value","id","test","addMenuItem","title","sortOrder","parent","undefined","fullId","concat","some","item","menuItem","push","addMenuSection","isSection","addPage","getRegistration","registration","length","_toConsumableArray","page","_getCredentials","_asyncToGenerator","_regenerator","m","_callee","_guestConnection$shar","_guestConnection$shar2","guestConnection","imsToken","imsOrgId","_t","w","_context","p","n","attach","v","sharedContext","get","a","message","getCredentials","apply","arguments","_registerExtension","_callee2","_t2","_context2","register","methods","registerExtension"],"mappings":";;;AAYA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAtBH,IAuBMA,UAAU,gBAAA,YAAA;AAKd;;;;AAIG;EACH,SAAAA,UAAAA,CAAYC,WAAmB,EAAA;AAAAC,IAAAA,eAAA,OAAAF,UAAA,CAAA;IARd,IAAA,CAAAG,SAAS,GAAe,EAAE;IACnC,IAAA,CAAAC,SAAS,GAAkB,IAAI;IAQrC,IAAI,EAACH,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAA,MAAA,IAAXA,WAAW,CAAEI,IAAI,EAAE,CAAA,EAAE;AACxB,MAAA,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;AACjE,IAAA;AAEA,IAAA,IAAMC,SAAS,GAAGN,WAAW,CAACI,IAAI,EAAE;AACpC,IAAA,IAAI,CAAC,IAAI,CAACG,SAAS,CAACD,SAAS,CAAC,EAAE;AAC9B,MAAA,MAAM,IAAID,KAAK,CACb,qGAAqG,CACtG;AACH,IAAA;IAEA,IAAI,CAACL,WAAW,GAAGM,SAAS;AAC9B,EAAA;AAEA;;;;AAIG;EAJH,OAAAE,YAAA,CAAAT,UAAA,EAAA,CAAA;IAAAU,GAAA,EAAA,WAAA;AAAAC,IAAAA,KAAA,EAKQ,SAAAH,SAASA,CAACI,EAAU,EAAA;AAC1B,MAAA,OAAO,iBAAiB,CAACC,IAAI,CAACD,EAAE,CAAC;AACnC,IAAA;AAEA;;;;;;;AAOG;AAPH,GAAA,EAAA;IAAAF,GAAA,EAAA,aAAA;IAAAC,KAAA,EAQA,SAAAG,WAAWA,CAACF,EAAU,EAAEG,KAAa,EAAEC,SAAiB,EAAEC,MAA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AA,CAAA,CAAA;AAAA,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe-commerce/aio-experience-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A comprehensive TypeScript toolkit for building Adobe Commerce Admin UI extensions with React Spectrum components. Provides production-ready components and utilities for Adobe I/O extensibility platform integration.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"test": "jest",
|
|
26
26
|
"test:watch": "jest --watch",
|
|
27
27
|
"test:coverage": "jest --coverage",
|
|
28
|
-
"lint": "eslint src test
|
|
29
|
-
"lint:fix": "eslint src test --
|
|
28
|
+
"lint": "eslint src test",
|
|
29
|
+
"lint:fix": "eslint src test --fix",
|
|
30
30
|
"format": "prettier --write \"{src,test}/**/*.{ts,tsx}\"",
|
|
31
31
|
"format:check": "prettier --check \"{src,test}/**/*.{ts,tsx}\"",
|
|
32
32
|
"typecheck": "tsc --noEmit",
|
|
@@ -61,50 +61,51 @@
|
|
|
61
61
|
"react-router-dom": ">=6.0.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@adobe/react-spectrum": "^3.
|
|
65
|
-
"@adobe/uix-guest": "^1.0.
|
|
66
|
-
"@react-spectrum/provider": "^3.
|
|
67
|
-
"@react-spectrum/theme-default": "^3.
|
|
64
|
+
"@adobe/react-spectrum": "^3.45.0",
|
|
65
|
+
"@adobe/uix-guest": "^1.0.5",
|
|
66
|
+
"@react-spectrum/provider": "^3.10.11",
|
|
67
|
+
"@react-spectrum/theme-default": "^3.5.22"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/core": "^7.24.0",
|
|
71
71
|
"@babel/preset-env": "^7.24.0",
|
|
72
72
|
"@babel/preset-react": "^7.24.0",
|
|
73
73
|
"@babel/preset-typescript": "^7.24.0",
|
|
74
|
-
"@commitlint/cli": "^
|
|
75
|
-
"@commitlint/config-conventional": "^
|
|
74
|
+
"@commitlint/cli": "^20.1.0",
|
|
75
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
76
|
+
"@eslint/js": "^9.37.0",
|
|
76
77
|
"@rollup/plugin-babel": "^6.0.4",
|
|
77
|
-
"@rollup/plugin-commonjs": "^
|
|
78
|
-
"@rollup/plugin-node-resolve": "^
|
|
79
|
-
"@rollup/plugin-typescript": "^
|
|
80
|
-
"@testing-library/jest-dom": "^6.
|
|
81
|
-
"@testing-library/react": "^
|
|
82
|
-
"@testing-library/user-event": "^14.
|
|
83
|
-
"@types/jest": "^
|
|
84
|
-
"@types/react": "^18.
|
|
85
|
-
"@types/react-dom": "^18.
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
87
|
-
"@typescript-eslint/parser": "^8.
|
|
88
|
-
"eslint": "^
|
|
89
|
-
"eslint-config-prettier": "^
|
|
78
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
79
|
+
"@rollup/plugin-node-resolve": "^16.0.2",
|
|
80
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
81
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
82
|
+
"@testing-library/react": "^16.3.0",
|
|
83
|
+
"@testing-library/user-event": "^14.6.1",
|
|
84
|
+
"@types/jest": "^30.0.0",
|
|
85
|
+
"@types/react": "^18.3.26",
|
|
86
|
+
"@types/react-dom": "^18.3.7",
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
|
88
|
+
"@typescript-eslint/parser": "^8.46.0",
|
|
89
|
+
"eslint": "^9.37.0",
|
|
90
|
+
"eslint-config-prettier": "^10.1.8",
|
|
90
91
|
"eslint-plugin-prettier": "^5.5.4",
|
|
91
|
-
"eslint-plugin-react": "^7.
|
|
92
|
-
"eslint-plugin-react-hooks": "^
|
|
92
|
+
"eslint-plugin-react": "^7.37.5",
|
|
93
|
+
"eslint-plugin-react-hooks": "^7.0.0",
|
|
93
94
|
"husky": "^9.1.7",
|
|
94
95
|
"identity-obj-proxy": "^3.0.0",
|
|
95
|
-
"jest": "^
|
|
96
|
-
"jest-environment-jsdom": "^
|
|
97
|
-
"lint-staged": "^16.
|
|
98
|
-
"prettier": "^3.2
|
|
99
|
-
"react": "^18.
|
|
100
|
-
"react-dom": "^18.
|
|
96
|
+
"jest": "^30.2.0",
|
|
97
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
98
|
+
"lint-staged": "^16.2.3",
|
|
99
|
+
"prettier": "^3.6.2",
|
|
100
|
+
"react": "^18.3.1",
|
|
101
|
+
"react-dom": "^18.3.1",
|
|
101
102
|
"react-router-dom": "^6.30.1",
|
|
102
|
-
"rimraf": "^
|
|
103
|
-
"rollup": "^4.
|
|
103
|
+
"rimraf": "^6.0.1",
|
|
104
|
+
"rollup": "^4.52.4",
|
|
104
105
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
105
|
-
"ts-jest": "^29.4.
|
|
106
|
-
"tslib": "^2.
|
|
107
|
-
"typescript": "^5.
|
|
106
|
+
"ts-jest": "^29.4.4",
|
|
107
|
+
"tslib": "^2.8.1",
|
|
108
|
+
"typescript": "^5.9.3"
|
|
108
109
|
},
|
|
109
110
|
"lint-staged": {
|
|
110
111
|
"src/**/*.{ts,tsx}": [
|