@adobe/aio-commerce-lib-admin-ui 0.2.0 → 1.0.0

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @adobe/aio-commerce-lib-admin-ui
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#599](https://github.com/adobe/aio-commerce-sdk/pull/599) [`ac6c13b`](https://github.com/adobe/aio-commerce-sdk/commit/ac6c13b4124677820f8946c92e4cd63ab228eeae) Thanks [@obarcelonap](https://github.com/obarcelonap)! - Release the first stable version.
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  ### Minor Changes
@@ -16,7 +16,6 @@ import { n as getAclResourceId, t as AdminUiEntity } from "../acl-resource-id-DB
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";
19
-
20
19
  //#region source/errors.d.ts
21
20
  /** Base error for Admin UI SDK permission helper failures. */
22
21
  declare class AdminUiPermissionError extends CommerceSdkErrorBase {}
@@ -48,14 +47,17 @@ type AdminUiApiClient = ReturnType<typeof createAdminUiApiClient>;
48
47
  //#region source/api/lib/permission-client.d.ts
49
48
  /** Options used to create an Admin UI SDK permission client. */
50
49
  type AdminUiPermissionClientOptions = {
51
- /** The application's `metadata.id` value. When provided, `check()` and `require()` can be called with no resource argument. */appId?: string;
50
+ /** The application's `metadata.id` value. When provided, `check()` and `require()` can be called with no resource argument. */
51
+ appId?: string;
52
52
  /**
53
53
  * Milliseconds to cache a permission result. Default: 300_000 (5 minutes).
54
54
  * Set to 0 to disable result caching. Note: in-flight deduplication of concurrent identical
55
55
  * requests is independent of this setting and remains active even when caching is disabled.
56
56
  */
57
- cacheTtlMs?: number; /** Return false instead of throwing when a network or parse error occurs. Default: true. */
58
- denyOnError?: boolean; /** Commerce HTTP client used to call the Admin UI SDK permission endpoint. */
57
+ cacheTtlMs?: number;
58
+ /** Return false instead of throwing when a network or parse error occurs. Default: true. */
59
+ denyOnError?: boolean;
60
+ /** Commerce HTTP client used to call the Admin UI SDK permission endpoint. */
59
61
  httpClient: AdobeCommerceHttpClient;
60
62
  };
61
63
  /** Client for checking the current user's Admin UI SDK resource permissions. */
@@ -15,7 +15,6 @@
15
15
  import { t as AdminUiEntity } from "../acl-resource-id-DBlYU0DE.cjs";
16
16
  import * as v from "valibot";
17
17
  import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
18
-
19
18
  //#region source/grid-columns/acl-resource-id.d.ts
20
19
  /**
21
20
  * Derives the deterministic Commerce ACL resource id for a grid column.
@@ -15,7 +15,6 @@
15
15
  import { t as AdminUiEntity } from "../acl-resource-id-DBlYU0DE.cjs";
16
16
  import * as v from "valibot";
17
17
  import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
18
-
19
18
  //#region source/mass-actions/acl-resource-id.d.ts
20
19
  /**
21
20
  * Derives the deterministic Commerce ACL resource id for a mass action.
@@ -14,7 +14,6 @@
14
14
 
15
15
  import * as v from "valibot";
16
16
  import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
17
-
18
17
  //#region source/order-view-buttons/acl-resource-id.d.ts
19
18
  /**
20
19
  * Derives the deterministic Commerce ACL resource id for an order view button.
@@ -15,7 +15,6 @@
15
15
  import { ReactNode } from "react";
16
16
  import { attach } from "@adobe/uix-guest";
17
17
  import { NavigateOptions, ToOptions } from "@tanstack/react-router";
18
-
19
18
  //#region source/web/react/auth/types.d.ts
20
19
  /** The IMS credentials provided by the host (Commerce Admin or Experience Cloud shell). */
21
20
  type ImsContext = {
@@ -64,13 +63,18 @@ type GuestConnection = Awaited<ReturnType<typeof attach>>;
64
63
  * which are also available in the Experience Cloud shell.
65
64
  */
66
65
  type SharedContext = {
67
- /** The extension ID of the app. */extensionId: string; /** The live `sharedContext` object provided by the host. */
68
- sharedContext: NonNullable<GuestConnection["sharedContext"]>; /** The host proxy, used by `useHostConnection` to invoke host-frame actions (close/onError). */
66
+ /** The extension ID of the app. */
67
+ extensionId: string;
68
+ /** The live `sharedContext` object provided by the host. */
69
+ sharedContext: NonNullable<GuestConnection["sharedContext"]>;
70
+ /** The host proxy, used by `useHostConnection` to invoke host-frame actions (close/onError). */
69
71
  host: NonNullable<GuestConnection["host"]>;
70
72
  };
71
73
  /** Actions for closing the extension iframe and returning control to the Commerce Admin. */
72
74
  type HostConnection = {
73
- /** Closes the iframe and navigates back to the originating grid or order. */close: () => Promise<void>; /** Closes the iframe and navigates back, flagging the originating page that an error occurred. */
75
+ /** Closes the iframe and navigates back to the originating grid or order. */
76
+ close: () => Promise<void>;
77
+ /** Closes the iframe and navigates back, flagging the originating page that an error occurred. */
74
78
  closeWithError: () => Promise<void>;
75
79
  };
76
80
  /** The context shared with mass-action extension points. */
@@ -108,7 +112,6 @@ declare function useSharedContext(): Result<SharedContext>;
108
112
  type CommerceData = {
109
113
  commerceHost: string;
110
114
  };
111
- /** Drops a failed Commerce host resolution for `extensionId`, so a later render retries it. */
112
115
  /**
113
116
  * Returns the host (domain) of the Commerce Admin the extension is embedded in, resolving it over
114
117
  * the guest connection.
@@ -161,18 +164,25 @@ declare module "@react-spectrum/s2/Provider" {
161
164
  }
162
165
  /** Defines a route that exists at a given path. */
163
166
  type ExtensionRoute = {
164
- /** The path for the route. */path: string; /** The React element to render for the route. */
167
+ /** The path for the route. */
168
+ path: string;
169
+ /** The React element to render for the route. */
165
170
  element: ReactNode;
166
171
  };
167
172
  //#endregion
168
173
  //#region source/web/react/extension/create-app.d.ts
169
174
  /** Configuration options when instantiating an extension app. */
170
175
  type CreateExtensionAppOptions = {
171
- /** General metadata about the extension app. */metadata: {
172
- /** The unique identifier for the extension app. */extensionId: string;
173
- }; /** The optional app page opened from the Commerce Admin menu and by default in Experience Cloud Shell. */
174
- menu?: ReactNode; /** Optional root element where the app will be mounted. */
175
- root?: HTMLElement; /** Additional path-based routes for the extension app. */
176
+ /** General metadata about the extension app. */
177
+ metadata: {
178
+ /** The unique identifier for the extension app. */
179
+ extensionId: string;
180
+ };
181
+ /** The optional app page opened from the Commerce Admin menu and by default in Experience Cloud Shell. */
182
+ menu?: ReactNode;
183
+ /** Optional root element where the app will be mounted. */
184
+ root?: HTMLElement;
185
+ /** Additional path-based routes for the extension app. */
176
186
  routes?: ExtensionRoute[];
177
187
  };
178
188
  /**
@@ -196,11 +206,6 @@ type CreateExtensionAppOptions = {
196
206
  * });
197
207
  * ```
198
208
  */
199
- declare function createExtensionApp({
200
- menu,
201
- metadata,
202
- routes,
203
- root: customRoot
204
- }: CreateExtensionAppOptions): void;
209
+ declare function createExtensionApp({ menu, metadata, routes, root: customRoot }: CreateExtensionAppOptions): void;
205
210
  //#endregion
206
211
  export { type CreateExtensionAppOptions, type ExtensionRoute, type HostConnection, type ImsContext, type MassActionContext, type OrderViewButtonContext, type SharedContext, createExtensionApp, useCommerce, useHostConnection, useIms, useMassActionContext, useOrderViewButtonContext, useSharedContext };
@@ -16,7 +16,6 @@ import { n as getAclResourceId, t as AdminUiEntity } from "../acl-resource-id-DB
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";
19
-
20
19
  //#region source/errors.d.ts
21
20
  /** Base error for Admin UI SDK permission helper failures. */
22
21
  declare class AdminUiPermissionError extends CommerceSdkErrorBase {}
@@ -48,14 +47,17 @@ type AdminUiApiClient = ReturnType<typeof createAdminUiApiClient>;
48
47
  //#region source/api/lib/permission-client.d.ts
49
48
  /** Options used to create an Admin UI SDK permission client. */
50
49
  type AdminUiPermissionClientOptions = {
51
- /** The application's `metadata.id` value. When provided, `check()` and `require()` can be called with no resource argument. */appId?: string;
50
+ /** The application's `metadata.id` value. When provided, `check()` and `require()` can be called with no resource argument. */
51
+ appId?: string;
52
52
  /**
53
53
  * Milliseconds to cache a permission result. Default: 300_000 (5 minutes).
54
54
  * Set to 0 to disable result caching. Note: in-flight deduplication of concurrent identical
55
55
  * requests is independent of this setting and remains active even when caching is disabled.
56
56
  */
57
- cacheTtlMs?: number; /** Return false instead of throwing when a network or parse error occurs. Default: true. */
58
- denyOnError?: boolean; /** Commerce HTTP client used to call the Admin UI SDK permission endpoint. */
57
+ cacheTtlMs?: number;
58
+ /** Return false instead of throwing when a network or parse error occurs. Default: true. */
59
+ denyOnError?: boolean;
60
+ /** Commerce HTTP client used to call the Admin UI SDK permission endpoint. */
59
61
  httpClient: AdobeCommerceHttpClient;
60
62
  };
61
63
  /** Client for checking the current user's Admin UI SDK resource permissions. */
@@ -15,7 +15,6 @@
15
15
  import { t as AdminUiEntity } from "../acl-resource-id-DBlYU0DE.mjs";
16
16
  import * as v from "valibot";
17
17
  import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
18
-
19
18
  //#region source/grid-columns/acl-resource-id.d.ts
20
19
  /**
21
20
  * Derives the deterministic Commerce ACL resource id for a grid column.
@@ -15,7 +15,6 @@
15
15
  import { t as AdminUiEntity } from "../acl-resource-id-DBlYU0DE.mjs";
16
16
  import * as v from "valibot";
17
17
  import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
18
-
19
18
  //#region source/mass-actions/acl-resource-id.d.ts
20
19
  /**
21
20
  * Derives the deterministic Commerce ACL resource id for a mass action.
@@ -14,7 +14,6 @@
14
14
 
15
15
  import * as v from "valibot";
16
16
  import { ErrorResponse, SuccessResponse } from "@adobe/aio-commerce-lib-core/responses";
17
-
18
17
  //#region source/order-view-buttons/acl-resource-id.d.ts
19
18
  /**
20
19
  * Derives the deterministic Commerce ACL resource id for an order view button.
@@ -15,7 +15,6 @@
15
15
  import { ReactNode } from "react";
16
16
  import { NavigateOptions, ToOptions } from "@tanstack/react-router";
17
17
  import { attach } from "@adobe/uix-guest";
18
-
19
18
  //#region source/web/react/auth/types.d.ts
20
19
  /** The IMS credentials provided by the host (Commerce Admin or Experience Cloud shell). */
21
20
  type ImsContext = {
@@ -64,13 +63,18 @@ type GuestConnection = Awaited<ReturnType<typeof attach>>;
64
63
  * which are also available in the Experience Cloud shell.
65
64
  */
66
65
  type SharedContext = {
67
- /** The extension ID of the app. */extensionId: string; /** The live `sharedContext` object provided by the host. */
68
- sharedContext: NonNullable<GuestConnection["sharedContext"]>; /** The host proxy, used by `useHostConnection` to invoke host-frame actions (close/onError). */
66
+ /** The extension ID of the app. */
67
+ extensionId: string;
68
+ /** The live `sharedContext` object provided by the host. */
69
+ sharedContext: NonNullable<GuestConnection["sharedContext"]>;
70
+ /** The host proxy, used by `useHostConnection` to invoke host-frame actions (close/onError). */
69
71
  host: NonNullable<GuestConnection["host"]>;
70
72
  };
71
73
  /** Actions for closing the extension iframe and returning control to the Commerce Admin. */
72
74
  type HostConnection = {
73
- /** Closes the iframe and navigates back to the originating grid or order. */close: () => Promise<void>; /** Closes the iframe and navigates back, flagging the originating page that an error occurred. */
75
+ /** Closes the iframe and navigates back to the originating grid or order. */
76
+ close: () => Promise<void>;
77
+ /** Closes the iframe and navigates back, flagging the originating page that an error occurred. */
74
78
  closeWithError: () => Promise<void>;
75
79
  };
76
80
  /** The context shared with mass-action extension points. */
@@ -108,7 +112,6 @@ declare function useSharedContext(): Result<SharedContext>;
108
112
  type CommerceData = {
109
113
  commerceHost: string;
110
114
  };
111
- /** Drops a failed Commerce host resolution for `extensionId`, so a later render retries it. */
112
115
  /**
113
116
  * Returns the host (domain) of the Commerce Admin the extension is embedded in, resolving it over
114
117
  * the guest connection.
@@ -161,18 +164,25 @@ declare module "@react-spectrum/s2/Provider" {
161
164
  }
162
165
  /** Defines a route that exists at a given path. */
163
166
  type ExtensionRoute = {
164
- /** The path for the route. */path: string; /** The React element to render for the route. */
167
+ /** The path for the route. */
168
+ path: string;
169
+ /** The React element to render for the route. */
165
170
  element: ReactNode;
166
171
  };
167
172
  //#endregion
168
173
  //#region source/web/react/extension/create-app.d.ts
169
174
  /** Configuration options when instantiating an extension app. */
170
175
  type CreateExtensionAppOptions = {
171
- /** General metadata about the extension app. */metadata: {
172
- /** The unique identifier for the extension app. */extensionId: string;
173
- }; /** The optional app page opened from the Commerce Admin menu and by default in Experience Cloud Shell. */
174
- menu?: ReactNode; /** Optional root element where the app will be mounted. */
175
- root?: HTMLElement; /** Additional path-based routes for the extension app. */
176
+ /** General metadata about the extension app. */
177
+ metadata: {
178
+ /** The unique identifier for the extension app. */
179
+ extensionId: string;
180
+ };
181
+ /** The optional app page opened from the Commerce Admin menu and by default in Experience Cloud Shell. */
182
+ menu?: ReactNode;
183
+ /** Optional root element where the app will be mounted. */
184
+ root?: HTMLElement;
185
+ /** Additional path-based routes for the extension app. */
176
186
  routes?: ExtensionRoute[];
177
187
  };
178
188
  /**
@@ -196,11 +206,6 @@ type CreateExtensionAppOptions = {
196
206
  * });
197
207
  * ```
198
208
  */
199
- declare function createExtensionApp({
200
- menu,
201
- metadata,
202
- routes,
203
- root: customRoot
204
- }: CreateExtensionAppOptions): void;
209
+ declare function createExtensionApp({ menu, metadata, routes, root: customRoot }: CreateExtensionAppOptions): void;
205
210
  //#endregion
206
211
  export { type CreateExtensionAppOptions, type ExtensionRoute, type HostConnection, type ImsContext, type MassActionContext, type OrderViewButtonContext, type SharedContext, createExtensionApp, useCommerce, useHostConnection, useIms, useMassActionContext, useOrderViewButtonContext, useSharedContext };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@adobe/aio-commerce-lib-admin-ui",
3
3
  "type": "module",
4
4
  "author": "Adobe Inc.",
5
- "version": "0.2.0",
5
+ "version": "1.0.0",
6
6
  "private": false,
7
7
  "engines": {
8
8
  "node": ">=22 <=24"
@@ -142,10 +142,10 @@
142
142
  "@aio-commerce-sdk/common-utils": "0.2.6",
143
143
  "@aio-commerce-sdk/config-tsdown": "1.0.1",
144
144
  "@aio-commerce-sdk/config-typedoc": "1.0.0",
145
- "@aio-commerce-sdk/config-typescript": "1.0.0",
146
145
  "@aio-commerce-sdk/config-vitest": "1.0.0",
147
146
  "@aio-commerce-sdk/scripting-utils": "0.3.4",
148
- "@aio-commerce-sdk/scripts": "0.1.0"
147
+ "@aio-commerce-sdk/scripts": "0.1.0",
148
+ "@aio-commerce-sdk/config-typescript": "1.0.0"
149
149
  },
150
150
  "sideEffects": false,
151
151
  "scripts": {