@adobe/aio-commerce-lib-admin-ui 1.1.0 → 1.2.0-beta-20260930143021
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 +13 -0
- package/dist/cjs/{acl-resource-id-B1UPaYNV.d.cts → acl-resource-id-Bha1pOIk.d.cts} +19 -2
- package/dist/{es/acl-resource-id-CIxfW36q.mjs → cjs/acl-resource-id-nCj_Kne2.cjs} +58 -1
- package/dist/cjs/api/index.cjs +1 -1
- package/dist/cjs/api/index.d.cts +1 -1
- package/dist/cjs/grid-columns/index.cjs +7 -7
- package/dist/cjs/grid-columns/index.d.cts +8 -4
- package/dist/cjs/mass-actions/index.cjs +3 -7
- package/dist/cjs/mass-actions/index.d.cts +6 -6
- package/dist/cjs/menu/index.cjs +1 -1
- package/dist/cjs/order-view-buttons/index.cjs +1 -1
- package/dist/es/{acl-resource-id-B1UPaYNV.d.mts → acl-resource-id-Bha1pOIk.d.mts} +19 -2
- package/dist/{cjs/acl-resource-id-BHCq3fxA.cjs → es/acl-resource-id-CHw95qd2.mjs} +29 -18
- package/dist/es/api/index.d.mts +1 -1
- package/dist/es/api/index.mjs +1 -1
- package/dist/es/grid-columns/index.d.mts +8 -4
- package/dist/es/grid-columns/index.mjs +7 -7
- package/dist/es/mass-actions/index.d.mts +6 -6
- package/dist/es/mass-actions/index.mjs +3 -7
- package/dist/es/menu/index.mjs +1 -1
- package/dist/es/order-view-buttons/index.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @adobe/aio-commerce-lib-admin-ui
|
|
2
2
|
|
|
3
|
+
## 1.2.0-beta-20260930143021
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#692](https://github.com/adobe/aio-commerce-sdk/pull/692) [`264539a`](https://github.com/adobe/aio-commerce-sdk/commit/264539a13371b11b637eb01fd1c0aa185f4349cc) Thanks [@asalloum5](https://github.com/asalloum5)! - Add `invoice`, `creditmemo`, and `shipment` grid types to the grid column wire contract, so runtime action handlers and `getGridColumnAclResourceId` can target those grids in addition to order, product, and customer. Export a `MassActionEntity` type that reflects the entities mass actions actually support (order, product, customer); `getMassActionAclResourceId` now accepts it instead of the wider grid entity type.
|
|
8
|
+
|
|
9
|
+
- [#699](https://github.com/adobe/aio-commerce-sdk/pull/699) [`53f1f8b`](https://github.com/adobe/aio-commerce-sdk/commit/53f1f8be4428862015294f1edc2816972e501a9e) Thanks [@mariam21arauj](https://github.com/mariam21arauj)! - Support the `newsletter` entity in grid-column and mass-action request parsing and ACL resource id helpers, so handlers can serve Newsletter Subscriber grids and mass actions.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies []:
|
|
14
|
+
- @adobe/aio-commerce-lib-api@1.4.1-beta-20260930143021
|
|
15
|
+
|
|
3
16
|
## 1.1.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -62,7 +62,24 @@ declare function getAclResourceId(metadataId: string): string;
|
|
|
62
62
|
* @returns The full Commerce ACL resource id, or an empty string when `metadataId` is blank.
|
|
63
63
|
*/
|
|
64
64
|
declare function getCustomAclResourceId(metadataId: string, resourceId: string, childId?: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Commerce entities an Admin UI component can attach to, using the same spelling Commerce
|
|
67
|
+
* sends in the wire-contract `gridType` field. Credit memo grids send `"creditmemo"` on the
|
|
68
|
+
* wire — not `"creditMemo"` — even though the corresponding config key (`adminUi.creditMemo`)
|
|
69
|
+
* is camelCase.
|
|
70
|
+
*
|
|
71
|
+
* Single source of truth for the entity vocabulary: `GridTypeSchema` derives its picklist from it.
|
|
72
|
+
*/
|
|
73
|
+
declare const ADMIN_UI_GRID_ENTITIES: readonly ["order", "product", "customer", "invoice", "creditmemo", "shipment", "newsletter"];
|
|
65
74
|
/** Commerce entity an Admin UI component is attached to. */
|
|
66
|
-
type AdminUiEntity =
|
|
75
|
+
type AdminUiEntity = (typeof ADMIN_UI_GRID_ENTITIES)[number];
|
|
76
|
+
/**
|
|
77
|
+
* Entities that support mass actions — a subset of `ADMIN_UI_GRID_ENTITIES`. Mass actions, unlike
|
|
78
|
+
* grid columns, are not available on the invoice, credit memo, or shipment grids.
|
|
79
|
+
* `MassActionGridTypeSchema` derives its picklist from it.
|
|
80
|
+
*/
|
|
81
|
+
declare const MASS_ACTION_ENTITIES: readonly ["order", "product", "customer", "newsletter"];
|
|
82
|
+
/** Commerce entity a mass action is attached to. */
|
|
83
|
+
type MassActionEntity = (typeof MASS_ACTION_ENTITIES)[number];
|
|
67
84
|
//#endregion
|
|
68
|
-
export { sanitizeSegment as i,
|
|
85
|
+
export { sanitizeSegment as a, getCustomAclResourceId as i, MassActionEntity as n, getAclResourceId as r, AdminUiEntity as t };
|
|
@@ -79,6 +79,63 @@ function getCustomAclResourceId(metadataId, resourceId, childId) {
|
|
|
79
79
|
const base = `${appRoot}_acl_${sanitizeSegment(resourceId)}`;
|
|
80
80
|
return childId === void 0 ? base : `${base}_${sanitizeSegment(childId)}`;
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Commerce entities an Admin UI component can attach to, using the same spelling Commerce
|
|
84
|
+
* sends in the wire-contract `gridType` field. Credit memo grids send `"creditmemo"` on the
|
|
85
|
+
* wire — not `"creditMemo"` — even though the corresponding config key (`adminUi.creditMemo`)
|
|
86
|
+
* is camelCase.
|
|
87
|
+
*
|
|
88
|
+
* Single source of truth for the entity vocabulary: `GridTypeSchema` derives its picklist from it.
|
|
89
|
+
*/
|
|
90
|
+
const ADMIN_UI_GRID_ENTITIES = [
|
|
91
|
+
"order",
|
|
92
|
+
"product",
|
|
93
|
+
"customer",
|
|
94
|
+
"invoice",
|
|
95
|
+
"creditmemo",
|
|
96
|
+
"shipment",
|
|
97
|
+
"newsletter"
|
|
98
|
+
];
|
|
99
|
+
/**
|
|
100
|
+
* Entities that support mass actions — a subset of `ADMIN_UI_GRID_ENTITIES`. Mass actions, unlike
|
|
101
|
+
* grid columns, are not available on the invoice, credit memo, or shipment grids.
|
|
102
|
+
* `MassActionGridTypeSchema` derives its picklist from it.
|
|
103
|
+
*/
|
|
104
|
+
const MASS_ACTION_ENTITIES = [
|
|
105
|
+
"order",
|
|
106
|
+
"product",
|
|
107
|
+
"customer",
|
|
108
|
+
"newsletter"
|
|
109
|
+
];
|
|
82
110
|
|
|
83
111
|
//#endregion
|
|
84
|
-
|
|
112
|
+
Object.defineProperty(exports, 'ADMIN_UI_GRID_ENTITIES', {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function () {
|
|
115
|
+
return ADMIN_UI_GRID_ENTITIES;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, 'MASS_ACTION_ENTITIES', {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () {
|
|
121
|
+
return MASS_ACTION_ENTITIES;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, 'getAclResourceId', {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function () {
|
|
127
|
+
return getAclResourceId;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, 'getCustomAclResourceId', {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () {
|
|
133
|
+
return getCustomAclResourceId;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(exports, 'sanitizeSegment', {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () {
|
|
139
|
+
return sanitizeSegment;
|
|
140
|
+
}
|
|
141
|
+
});
|
package/dist/cjs/api/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
16
|
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
17
|
+
const require_acl_resource_id = require('../acl-resource-id-nCj_Kne2.cjs');
|
|
18
18
|
const require_utils = require('../utils-CiBhSMw4.cjs');
|
|
19
19
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
|
20
20
|
let _adobe_aio_commerce_lib_api = require("@adobe/aio-commerce-lib-api");
|
package/dist/cjs/api/index.d.cts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { a as sanitizeSegment, i as getCustomAclResourceId, r as getAclResourceId, t as AdminUiEntity } from "../acl-resource-id-Bha1pOIk.cjs";
|
|
16
16
|
import { CommerceSdkErrorBase, CommerceSdkErrorOptions } from "@adobe/aio-commerce-lib-core/error";
|
|
17
17
|
import { AdobeCommerceHttpClient, CommerceHttpClientParams } from "@adobe/aio-commerce-lib-api";
|
|
18
18
|
import * as v from "valibot";
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
16
|
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
17
|
+
const require_acl_resource_id = require('../acl-resource-id-nCj_Kne2.cjs');
|
|
18
18
|
const require_schemas = require('../schemas-DRhCF0TF.cjs');
|
|
19
19
|
const require_utils = require('../utils-CiBhSMw4.cjs');
|
|
20
20
|
let valibot = require("valibot");
|
|
@@ -40,7 +40,8 @@ let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-co
|
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`).
|
|
43
|
-
* @param entity - The grid's Commerce entity (`"order"`, `"product"`,
|
|
43
|
+
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, `"customer"`, `"invoice"`,
|
|
44
|
+
* `"creditmemo"`, `"shipment"`, or `"newsletter"`).
|
|
44
45
|
* @param columnId - The column's `id` value from `adminUi.<entity>.gridColumns.columns[].id`.
|
|
45
46
|
* @returns The full Commerce ACL resource id for the grid-column leaf node, or an empty string
|
|
46
47
|
* when `metadataId` is blank.
|
|
@@ -56,13 +57,12 @@ function getGridColumnAclResourceId(metadataId, entity, columnId) {
|
|
|
56
57
|
/**
|
|
57
58
|
* Grid identifier sent by Commerce on the `commerce/backend-ui/2` wire contract.
|
|
58
59
|
*
|
|
60
|
+
* Credit memo grids send `"creditmemo"` — not `"creditMemo"` — even though the corresponding
|
|
61
|
+
* config key (`adminUi.creditMemo`) is camelCase; see the Commerce module's `CustomColumn::GRID_MAP`.
|
|
62
|
+
*
|
|
59
63
|
* @see {@link https://github.com/magento-commerce/adobe-commerce-backend-uix Magento module reference}
|
|
60
64
|
*/
|
|
61
|
-
const GridTypeSchema = valibot.picklist(
|
|
62
|
-
"order",
|
|
63
|
-
"product",
|
|
64
|
-
"customer"
|
|
65
|
-
]);
|
|
65
|
+
const GridTypeSchema = valibot.picklist(require_acl_resource_id.ADMIN_UI_GRID_ENTITIES);
|
|
66
66
|
/**
|
|
67
67
|
* Schema for the JSON body Commerce POSTs to a grid column handler.
|
|
68
68
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { t as AdminUiEntity } from "../acl-resource-id-
|
|
15
|
+
import { t as AdminUiEntity } from "../acl-resource-id-Bha1pOIk.cjs";
|
|
16
16
|
import * as v from "valibot";
|
|
17
17
|
import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
|
|
18
18
|
//#region source/grid-columns/acl-resource-id.d.ts
|
|
@@ -34,7 +34,8 @@ import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/res
|
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
36
|
* @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`).
|
|
37
|
-
* @param entity - The grid's Commerce entity (`"order"`, `"product"`,
|
|
37
|
+
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, `"customer"`, `"invoice"`,
|
|
38
|
+
* `"creditmemo"`, `"shipment"`, or `"newsletter"`).
|
|
38
39
|
* @param columnId - The column's `id` value from `adminUi.<entity>.gridColumns.columns[].id`.
|
|
39
40
|
* @returns The full Commerce ACL resource id for the grid-column leaf node, or an empty string
|
|
40
41
|
* when `metadataId` is blank.
|
|
@@ -45,9 +46,12 @@ export declare function getGridColumnAclResourceId(metadataId: string, entity: A
|
|
|
45
46
|
/**
|
|
46
47
|
* Grid identifier sent by Commerce on the `commerce/backend-ui/2` wire contract.
|
|
47
48
|
*
|
|
49
|
+
* Credit memo grids send `"creditmemo"` — not `"creditMemo"` — even though the corresponding
|
|
50
|
+
* config key (`adminUi.creditMemo`) is camelCase; see the Commerce module's `CustomColumn::GRID_MAP`.
|
|
51
|
+
*
|
|
48
52
|
* @see {@link https://github.com/magento-commerce/adobe-commerce-backend-uix Magento module reference}
|
|
49
53
|
*/
|
|
50
|
-
export declare const GridTypeSchema: v.PicklistSchema<["order", "product", "customer"], undefined>;
|
|
54
|
+
export declare const GridTypeSchema: v.PicklistSchema<readonly ["order", "product", "customer", "invoice", "creditmemo", "shipment", "newsletter"], undefined>;
|
|
51
55
|
/**
|
|
52
56
|
* Schema for the JSON body Commerce POSTs to a grid column handler.
|
|
53
57
|
*
|
|
@@ -56,7 +60,7 @@ export declare const GridTypeSchema: v.PicklistSchema<["order", "product", "cust
|
|
|
56
60
|
* enforced here.
|
|
57
61
|
*/
|
|
58
62
|
export declare const GridRequestSchema: v.ObjectSchema<{
|
|
59
|
-
readonly gridType: v.PicklistSchema<["order", "product", "customer"], undefined>;
|
|
63
|
+
readonly gridType: v.PicklistSchema<readonly ["order", "product", "customer", "invoice", "creditmemo", "shipment", "newsletter"], undefined>;
|
|
60
64
|
readonly ids: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>, v.MinLengthAction<string[], 1, "The value of \"ids\" must contain at least one entry">]>;
|
|
61
65
|
readonly requestId: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
|
|
62
66
|
}, undefined>;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
16
|
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
17
|
+
const require_acl_resource_id = require('../acl-resource-id-nCj_Kne2.cjs');
|
|
18
18
|
const require_schemas = require('../schemas-DRhCF0TF.cjs');
|
|
19
19
|
const require_utils = require('../utils-CiBhSMw4.cjs');
|
|
20
20
|
let valibot = require("valibot");
|
|
@@ -40,7 +40,7 @@ let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-co
|
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`).
|
|
43
|
-
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, or `"
|
|
43
|
+
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, `"customer"`, or `"newsletter"`).
|
|
44
44
|
* @param actionId - The action's `id` value from `adminUi.<entity>.massActions[].id`.
|
|
45
45
|
* @returns The full Commerce ACL resource id for the mass-action leaf node, or an empty string
|
|
46
46
|
* when `metadataId` is blank.
|
|
@@ -57,11 +57,7 @@ function getMassActionAclResourceId(metadataId, entity, actionId) {
|
|
|
57
57
|
* Grid identifier sent by Commerce on the `commerce/backend-ui/2` wire contract
|
|
58
58
|
* for worker mass actions.
|
|
59
59
|
*/
|
|
60
|
-
const MassActionGridTypeSchema = valibot.picklist(
|
|
61
|
-
"order",
|
|
62
|
-
"product",
|
|
63
|
-
"customer"
|
|
64
|
-
]);
|
|
60
|
+
const MassActionGridTypeSchema = valibot.picklist(require_acl_resource_id.MASS_ACTION_ENTITIES);
|
|
65
61
|
/**
|
|
66
62
|
* Schema for the JSON body Commerce POSTs to a worker mass action handler.
|
|
67
63
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { t as AdminUiEntity } from "../acl-resource-id-
|
|
15
|
+
import { n as MassActionEntity, t as AdminUiEntity } from "../acl-resource-id-Bha1pOIk.cjs";
|
|
16
16
|
import * as v from "valibot";
|
|
17
17
|
import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
|
|
18
18
|
//#region source/mass-actions/acl-resource-id.d.ts
|
|
@@ -34,19 +34,19 @@ import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/res
|
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
36
|
* @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`).
|
|
37
|
-
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, or `"
|
|
37
|
+
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, `"customer"`, or `"newsletter"`).
|
|
38
38
|
* @param actionId - The action's `id` value from `adminUi.<entity>.massActions[].id`.
|
|
39
39
|
* @returns The full Commerce ACL resource id for the mass-action leaf node, or an empty string
|
|
40
40
|
* when `metadataId` is blank.
|
|
41
41
|
*/
|
|
42
|
-
export declare function getMassActionAclResourceId(metadataId: string, entity:
|
|
42
|
+
export declare function getMassActionAclResourceId(metadataId: string, entity: MassActionEntity, actionId: string): string;
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region source/mass-actions/worker/schema.d.ts
|
|
45
45
|
/**
|
|
46
46
|
* Grid identifier sent by Commerce on the `commerce/backend-ui/2` wire contract
|
|
47
47
|
* for worker mass actions.
|
|
48
48
|
*/
|
|
49
|
-
export declare const MassActionGridTypeSchema: v.PicklistSchema<["order", "product", "customer"], undefined>;
|
|
49
|
+
export declare const MassActionGridTypeSchema: v.PicklistSchema<readonly ["order", "product", "customer", "newsletter"], undefined>;
|
|
50
50
|
/**
|
|
51
51
|
* Schema for the JSON body Commerce POSTs to a worker mass action handler.
|
|
52
52
|
*
|
|
@@ -55,7 +55,7 @@ export declare const MassActionGridTypeSchema: v.PicklistSchema<["order", "produ
|
|
|
55
55
|
* enforced here.
|
|
56
56
|
*/
|
|
57
57
|
export declare const MassActionRequestSchema: v.ObjectSchema<{
|
|
58
|
-
readonly gridType: v.PicklistSchema<["order", "product", "customer"], undefined>;
|
|
58
|
+
readonly gridType: v.PicklistSchema<readonly ["order", "product", "customer", "newsletter"], undefined>;
|
|
59
59
|
readonly requestId: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
|
|
60
60
|
readonly selectedIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>, v.MinLengthAction<string[], 1, "The value of \"selectedIds\" must contain at least one entry">]>;
|
|
61
61
|
}, undefined>;
|
|
@@ -115,4 +115,4 @@ export declare function okMassActionResponse(body?: MassActionResponseBody): Suc
|
|
|
115
115
|
*/
|
|
116
116
|
export declare function massActionErrorResponse(statusCode: number, errorMessage: string): ErrorResponse<MassActionErrorBody>;
|
|
117
117
|
//#endregion
|
|
118
|
-
export type { AdminUiEntity, MassActionErrorBody, MassActionGridType, MassActionRequest, MassActionResponseBody };
|
|
118
|
+
export type { AdminUiEntity, MassActionEntity, MassActionErrorBody, MassActionGridType, MassActionRequest, MassActionResponseBody };
|
package/dist/cjs/menu/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
16
|
+
const require_acl_resource_id = require('../acl-resource-id-nCj_Kne2.cjs');
|
|
17
17
|
|
|
18
18
|
//#region source/menu/acl-resource-id.ts
|
|
19
19
|
/**
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
16
|
const require_rolldown_runtime = require('../rolldown-runtime-Bf2WWRga.cjs');
|
|
17
|
-
const require_acl_resource_id = require('../acl-resource-id-
|
|
17
|
+
const require_acl_resource_id = require('../acl-resource-id-nCj_Kne2.cjs');
|
|
18
18
|
const require_schemas = require('../schemas-DRhCF0TF.cjs');
|
|
19
19
|
const require_utils = require('../utils-CiBhSMw4.cjs');
|
|
20
20
|
let valibot = require("valibot");
|
|
@@ -62,7 +62,24 @@ declare function getAclResourceId(metadataId: string): string;
|
|
|
62
62
|
* @returns The full Commerce ACL resource id, or an empty string when `metadataId` is blank.
|
|
63
63
|
*/
|
|
64
64
|
declare function getCustomAclResourceId(metadataId: string, resourceId: string, childId?: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Commerce entities an Admin UI component can attach to, using the same spelling Commerce
|
|
67
|
+
* sends in the wire-contract `gridType` field. Credit memo grids send `"creditmemo"` on the
|
|
68
|
+
* wire — not `"creditMemo"` — even though the corresponding config key (`adminUi.creditMemo`)
|
|
69
|
+
* is camelCase.
|
|
70
|
+
*
|
|
71
|
+
* Single source of truth for the entity vocabulary: `GridTypeSchema` derives its picklist from it.
|
|
72
|
+
*/
|
|
73
|
+
declare const ADMIN_UI_GRID_ENTITIES: readonly ["order", "product", "customer", "invoice", "creditmemo", "shipment", "newsletter"];
|
|
65
74
|
/** Commerce entity an Admin UI component is attached to. */
|
|
66
|
-
type AdminUiEntity =
|
|
75
|
+
type AdminUiEntity = (typeof ADMIN_UI_GRID_ENTITIES)[number];
|
|
76
|
+
/**
|
|
77
|
+
* Entities that support mass actions — a subset of `ADMIN_UI_GRID_ENTITIES`. Mass actions, unlike
|
|
78
|
+
* grid columns, are not available on the invoice, credit memo, or shipment grids.
|
|
79
|
+
* `MassActionGridTypeSchema` derives its picklist from it.
|
|
80
|
+
*/
|
|
81
|
+
declare const MASS_ACTION_ENTITIES: readonly ["order", "product", "customer", "newsletter"];
|
|
82
|
+
/** Commerce entity a mass action is attached to. */
|
|
83
|
+
type MassActionEntity = (typeof MASS_ACTION_ENTITIES)[number];
|
|
67
84
|
//#endregion
|
|
68
|
-
export { sanitizeSegment as i,
|
|
85
|
+
export { sanitizeSegment as a, getCustomAclResourceId as i, MassActionEntity as n, getAclResourceId as r, AdminUiEntity as t };
|
|
@@ -79,23 +79,34 @@ function getCustomAclResourceId(metadataId, resourceId, childId) {
|
|
|
79
79
|
const base = `${appRoot}_acl_${sanitizeSegment(resourceId)}`;
|
|
80
80
|
return childId === void 0 ? base : `${base}_${sanitizeSegment(childId)}`;
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Commerce entities an Admin UI component can attach to, using the same spelling Commerce
|
|
84
|
+
* sends in the wire-contract `gridType` field. Credit memo grids send `"creditmemo"` on the
|
|
85
|
+
* wire — not `"creditMemo"` — even though the corresponding config key (`adminUi.creditMemo`)
|
|
86
|
+
* is camelCase.
|
|
87
|
+
*
|
|
88
|
+
* Single source of truth for the entity vocabulary: `GridTypeSchema` derives its picklist from it.
|
|
89
|
+
*/
|
|
90
|
+
const ADMIN_UI_GRID_ENTITIES = [
|
|
91
|
+
"order",
|
|
92
|
+
"product",
|
|
93
|
+
"customer",
|
|
94
|
+
"invoice",
|
|
95
|
+
"creditmemo",
|
|
96
|
+
"shipment",
|
|
97
|
+
"newsletter"
|
|
98
|
+
];
|
|
99
|
+
/**
|
|
100
|
+
* Entities that support mass actions — a subset of `ADMIN_UI_GRID_ENTITIES`. Mass actions, unlike
|
|
101
|
+
* grid columns, are not available on the invoice, credit memo, or shipment grids.
|
|
102
|
+
* `MassActionGridTypeSchema` derives its picklist from it.
|
|
103
|
+
*/
|
|
104
|
+
const MASS_ACTION_ENTITIES = [
|
|
105
|
+
"order",
|
|
106
|
+
"product",
|
|
107
|
+
"customer",
|
|
108
|
+
"newsletter"
|
|
109
|
+
];
|
|
82
110
|
|
|
83
111
|
//#endregion
|
|
84
|
-
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return getAclResourceId;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, 'getCustomAclResourceId', {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return getCustomAclResourceId;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, 'sanitizeSegment', {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return sanitizeSegment;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
112
|
+
export { sanitizeSegment as a, getCustomAclResourceId as i, MASS_ACTION_ENTITIES as n, getAclResourceId as r, ADMIN_UI_GRID_ENTITIES as t };
|
package/dist/es/api/index.d.mts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { a as sanitizeSegment, i as getCustomAclResourceId, r as getAclResourceId, t as AdminUiEntity } from "../acl-resource-id-Bha1pOIk.mjs";
|
|
16
16
|
import { CommerceSdkErrorBase, CommerceSdkErrorOptions } from "@adobe/aio-commerce-lib-core/error";
|
|
17
17
|
import { AdobeCommerceHttpClient, CommerceHttpClientParams } from "@adobe/aio-commerce-lib-api";
|
|
18
18
|
import * as v from "valibot";
|
package/dist/es/api/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { a as sanitizeSegment, i as getCustomAclResourceId, r as getAclResourceId } from "../acl-resource-id-CHw95qd2.mjs";
|
|
16
16
|
import { t as parseOrThrow } from "../utils-COPGW1HO.mjs";
|
|
17
17
|
import { CommerceSdkErrorBase } from "@adobe/aio-commerce-lib-core/error";
|
|
18
18
|
import { AdobeCommerceHttpClient, ApiClient } from "@adobe/aio-commerce-lib-api";
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { t as AdminUiEntity } from "../acl-resource-id-
|
|
15
|
+
import { t as AdminUiEntity } from "../acl-resource-id-Bha1pOIk.mjs";
|
|
16
16
|
import * as v from "valibot";
|
|
17
17
|
import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
|
|
18
18
|
//#region source/grid-columns/acl-resource-id.d.ts
|
|
@@ -34,7 +34,8 @@ import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/res
|
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
36
|
* @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`).
|
|
37
|
-
* @param entity - The grid's Commerce entity (`"order"`, `"product"`,
|
|
37
|
+
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, `"customer"`, `"invoice"`,
|
|
38
|
+
* `"creditmemo"`, `"shipment"`, or `"newsletter"`).
|
|
38
39
|
* @param columnId - The column's `id` value from `adminUi.<entity>.gridColumns.columns[].id`.
|
|
39
40
|
* @returns The full Commerce ACL resource id for the grid-column leaf node, or an empty string
|
|
40
41
|
* when `metadataId` is blank.
|
|
@@ -45,9 +46,12 @@ export declare function getGridColumnAclResourceId(metadataId: string, entity: A
|
|
|
45
46
|
/**
|
|
46
47
|
* Grid identifier sent by Commerce on the `commerce/backend-ui/2` wire contract.
|
|
47
48
|
*
|
|
49
|
+
* Credit memo grids send `"creditmemo"` — not `"creditMemo"` — even though the corresponding
|
|
50
|
+
* config key (`adminUi.creditMemo`) is camelCase; see the Commerce module's `CustomColumn::GRID_MAP`.
|
|
51
|
+
*
|
|
48
52
|
* @see {@link https://github.com/magento-commerce/adobe-commerce-backend-uix Magento module reference}
|
|
49
53
|
*/
|
|
50
|
-
export declare const GridTypeSchema: v.PicklistSchema<["order", "product", "customer"], undefined>;
|
|
54
|
+
export declare const GridTypeSchema: v.PicklistSchema<readonly ["order", "product", "customer", "invoice", "creditmemo", "shipment", "newsletter"], undefined>;
|
|
51
55
|
/**
|
|
52
56
|
* Schema for the JSON body Commerce POSTs to a grid column handler.
|
|
53
57
|
*
|
|
@@ -56,7 +60,7 @@ export declare const GridTypeSchema: v.PicklistSchema<["order", "product", "cust
|
|
|
56
60
|
* enforced here.
|
|
57
61
|
*/
|
|
58
62
|
export declare const GridRequestSchema: v.ObjectSchema<{
|
|
59
|
-
readonly gridType: v.PicklistSchema<["order", "product", "customer"], undefined>;
|
|
63
|
+
readonly gridType: v.PicklistSchema<readonly ["order", "product", "customer", "invoice", "creditmemo", "shipment", "newsletter"], undefined>;
|
|
60
64
|
readonly ids: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>, v.MinLengthAction<string[], 1, "The value of \"ids\" must contain at least one entry">]>;
|
|
61
65
|
readonly requestId: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
|
|
62
66
|
}, undefined>;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { a as sanitizeSegment, r as getAclResourceId, t as ADMIN_UI_GRID_ENTITIES } from "../acl-resource-id-CHw95qd2.mjs";
|
|
16
16
|
import { t as nonEmptyStringValueSchema } from "../schemas-BFT8ys8P.mjs";
|
|
17
17
|
import { t as parseOrThrow } from "../utils-COPGW1HO.mjs";
|
|
18
18
|
import * as v from "valibot";
|
|
@@ -37,7 +37,8 @@ import { buildErrorResponse, ok } from "@adobe/aio-commerce-lib-core/responses";
|
|
|
37
37
|
* ```
|
|
38
38
|
*
|
|
39
39
|
* @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`).
|
|
40
|
-
* @param entity - The grid's Commerce entity (`"order"`, `"product"`,
|
|
40
|
+
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, `"customer"`, `"invoice"`,
|
|
41
|
+
* `"creditmemo"`, `"shipment"`, or `"newsletter"`).
|
|
41
42
|
* @param columnId - The column's `id` value from `adminUi.<entity>.gridColumns.columns[].id`.
|
|
42
43
|
* @returns The full Commerce ACL resource id for the grid-column leaf node, or an empty string
|
|
43
44
|
* when `metadataId` is blank.
|
|
@@ -53,13 +54,12 @@ function getGridColumnAclResourceId(metadataId, entity, columnId) {
|
|
|
53
54
|
/**
|
|
54
55
|
* Grid identifier sent by Commerce on the `commerce/backend-ui/2` wire contract.
|
|
55
56
|
*
|
|
57
|
+
* Credit memo grids send `"creditmemo"` — not `"creditMemo"` — even though the corresponding
|
|
58
|
+
* config key (`adminUi.creditMemo`) is camelCase; see the Commerce module's `CustomColumn::GRID_MAP`.
|
|
59
|
+
*
|
|
56
60
|
* @see {@link https://github.com/magento-commerce/adobe-commerce-backend-uix Magento module reference}
|
|
57
61
|
*/
|
|
58
|
-
const GridTypeSchema = v.picklist(
|
|
59
|
-
"order",
|
|
60
|
-
"product",
|
|
61
|
-
"customer"
|
|
62
|
-
]);
|
|
62
|
+
const GridTypeSchema = v.picklist(ADMIN_UI_GRID_ENTITIES);
|
|
63
63
|
/**
|
|
64
64
|
* Schema for the JSON body Commerce POSTs to a grid column handler.
|
|
65
65
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { t as AdminUiEntity } from "../acl-resource-id-
|
|
15
|
+
import { n as MassActionEntity, t as AdminUiEntity } from "../acl-resource-id-Bha1pOIk.mjs";
|
|
16
16
|
import * as v from "valibot";
|
|
17
17
|
import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
|
|
18
18
|
//#region source/mass-actions/acl-resource-id.d.ts
|
|
@@ -34,19 +34,19 @@ import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/res
|
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
36
|
* @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`).
|
|
37
|
-
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, or `"
|
|
37
|
+
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, `"customer"`, or `"newsletter"`).
|
|
38
38
|
* @param actionId - The action's `id` value from `adminUi.<entity>.massActions[].id`.
|
|
39
39
|
* @returns The full Commerce ACL resource id for the mass-action leaf node, or an empty string
|
|
40
40
|
* when `metadataId` is blank.
|
|
41
41
|
*/
|
|
42
|
-
export declare function getMassActionAclResourceId(metadataId: string, entity:
|
|
42
|
+
export declare function getMassActionAclResourceId(metadataId: string, entity: MassActionEntity, actionId: string): string;
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region source/mass-actions/worker/schema.d.ts
|
|
45
45
|
/**
|
|
46
46
|
* Grid identifier sent by Commerce on the `commerce/backend-ui/2` wire contract
|
|
47
47
|
* for worker mass actions.
|
|
48
48
|
*/
|
|
49
|
-
export declare const MassActionGridTypeSchema: v.PicklistSchema<["order", "product", "customer"], undefined>;
|
|
49
|
+
export declare const MassActionGridTypeSchema: v.PicklistSchema<readonly ["order", "product", "customer", "newsletter"], undefined>;
|
|
50
50
|
/**
|
|
51
51
|
* Schema for the JSON body Commerce POSTs to a worker mass action handler.
|
|
52
52
|
*
|
|
@@ -55,7 +55,7 @@ export declare const MassActionGridTypeSchema: v.PicklistSchema<["order", "produ
|
|
|
55
55
|
* enforced here.
|
|
56
56
|
*/
|
|
57
57
|
export declare const MassActionRequestSchema: v.ObjectSchema<{
|
|
58
|
-
readonly gridType: v.PicklistSchema<["order", "product", "customer"], undefined>;
|
|
58
|
+
readonly gridType: v.PicklistSchema<readonly ["order", "product", "customer", "newsletter"], undefined>;
|
|
59
59
|
readonly requestId: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
|
|
60
60
|
readonly selectedIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>, v.MinLengthAction<string[], 1, "The value of \"selectedIds\" must contain at least one entry">]>;
|
|
61
61
|
}, undefined>;
|
|
@@ -115,4 +115,4 @@ export declare function okMassActionResponse(body?: MassActionResponseBody): Suc
|
|
|
115
115
|
*/
|
|
116
116
|
export declare function massActionErrorResponse(statusCode: number, errorMessage: string): ErrorResponse<MassActionErrorBody>;
|
|
117
117
|
//#endregion
|
|
118
|
-
export type { AdminUiEntity, MassActionErrorBody, MassActionGridType, MassActionRequest, MassActionResponseBody };
|
|
118
|
+
export type { AdminUiEntity, MassActionEntity, MassActionErrorBody, MassActionGridType, MassActionRequest, MassActionResponseBody };
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { a as sanitizeSegment, n as MASS_ACTION_ENTITIES, r as getAclResourceId } from "../acl-resource-id-CHw95qd2.mjs";
|
|
16
16
|
import { t as nonEmptyStringValueSchema } from "../schemas-BFT8ys8P.mjs";
|
|
17
17
|
import { t as parseOrThrow } from "../utils-COPGW1HO.mjs";
|
|
18
18
|
import * as v from "valibot";
|
|
@@ -37,7 +37,7 @@ import { buildErrorResponse, ok } from "@adobe/aio-commerce-lib-core/responses";
|
|
|
37
37
|
* ```
|
|
38
38
|
*
|
|
39
39
|
* @param metadataId - The application's `metadata.id` value (e.g. `"approval-dashboard-app"`).
|
|
40
|
-
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, or `"
|
|
40
|
+
* @param entity - The grid's Commerce entity (`"order"`, `"product"`, `"customer"`, or `"newsletter"`).
|
|
41
41
|
* @param actionId - The action's `id` value from `adminUi.<entity>.massActions[].id`.
|
|
42
42
|
* @returns The full Commerce ACL resource id for the mass-action leaf node, or an empty string
|
|
43
43
|
* when `metadataId` is blank.
|
|
@@ -54,11 +54,7 @@ function getMassActionAclResourceId(metadataId, entity, actionId) {
|
|
|
54
54
|
* Grid identifier sent by Commerce on the `commerce/backend-ui/2` wire contract
|
|
55
55
|
* for worker mass actions.
|
|
56
56
|
*/
|
|
57
|
-
const MassActionGridTypeSchema = v.picklist(
|
|
58
|
-
"order",
|
|
59
|
-
"product",
|
|
60
|
-
"customer"
|
|
61
|
-
]);
|
|
57
|
+
const MassActionGridTypeSchema = v.picklist(MASS_ACTION_ENTITIES);
|
|
62
58
|
/**
|
|
63
59
|
* Schema for the JSON body Commerce POSTs to a worker mass action handler.
|
|
64
60
|
*
|
package/dist/es/menu/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { a as sanitizeSegment, r as getAclResourceId } from "../acl-resource-id-CHw95qd2.mjs";
|
|
16
16
|
|
|
17
17
|
//#region source/menu/acl-resource-id.ts
|
|
18
18
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { a as sanitizeSegment, r as getAclResourceId } from "../acl-resource-id-CHw95qd2.mjs";
|
|
16
16
|
import { t as nonEmptyStringValueSchema } from "../schemas-BFT8ys8P.mjs";
|
|
17
17
|
import { t as parseOrThrow } from "../utils-COPGW1HO.mjs";
|
|
18
18
|
import * as v from "valibot";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aio-commerce-lib-admin-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-beta-20260930143021",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A library to interact with the Adobe Commerce Admin UI SDK API",
|
|
6
6
|
"keywords": [
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"README.md"
|
|
102
102
|
],
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@adobe/aio-commerce-lib-api": "1.4.
|
|
104
|
+
"@adobe/aio-commerce-lib-api": "1.4.1-beta-20260930143021",
|
|
105
105
|
"@adobe/aio-commerce-lib-core": "1.2.0",
|
|
106
106
|
"@adobe/exc-app": "^1.4.20",
|
|
107
107
|
"@adobe/uix-guest": "^1.0.3",
|