@adobe/aio-commerce-lib-admin-ui 1.0.1 → 1.1.0-beta-20260820174436

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.1.0-beta-20260820174436
4
+
5
+ ### Minor Changes
6
+
7
+ - [#626](https://github.com/adobe/aio-commerce-sdk/pull/626) [`f012ae0`](https://github.com/adobe/aio-commerce-sdk/commit/f012ae0d8eaac5cac314a62de3902fca842bd936) Thanks [@vinayrao2000](https://github.com/vinayrao2000)! - Add a `refreshExtension` client operation that re-syncs an Admin UI extension's registrations via the dedicated refresh endpoint, with its `RefreshExtensionParams` type and schema.
8
+
3
9
  ## 1.0.1
4
10
 
5
11
  ### Patch Changes
@@ -69,10 +69,16 @@ const UnregisterExtensionParamsSchema = valibot.object({
69
69
  extensionName: valibot.pipe(valibot.string(), valibot.minLength(1)),
70
70
  workspaceName: valibot.pipe(valibot.string(), valibot.minLength(1))
71
71
  });
72
+ /** Parameters for POST /V1/adminuisdk/extension/{workspaceName}/{extensionName}/refresh. */
73
+ const RefreshExtensionParamsSchema = valibot.object({
74
+ extensionName: valibot.pipe(valibot.string(), valibot.minLength(1)),
75
+ workspaceName: valibot.pipe(valibot.string(), valibot.minLength(1))
76
+ });
72
77
 
73
78
  //#endregion
74
79
  //#region source/api/extensions/endpoints.ts
75
80
  var endpoints_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
81
+ refreshExtension: () => refreshExtension,
76
82
  registerExtension: () => registerExtension,
77
83
  unregisterExtension: () => unregisterExtension
78
84
  });
@@ -107,6 +113,24 @@ async function unregisterExtension(httpClient, params, fetchOptions) {
107
113
  const { workspaceName, extensionName } = require_utils.parseOrThrow(UnregisterExtensionParamsSchema, params);
108
114
  return httpClient.delete(`adminuisdk/extension/${workspaceName}/${extensionName}`, fetchOptions).then((_res) => {});
109
115
  }
116
+ /**
117
+ * Refreshes an existing Admin UI extension's registrations from the App Registry via
118
+ * POST /V1/adminuisdk/extension/{workspaceName}/{extensionName}/refresh. Unlike
119
+ * {@link registerExtension}, this does not modify the extension record itself — it only
120
+ * re-syncs its registrations.
121
+ *
122
+ * @param httpClient - The {@link AdobeCommerceHttpClient} to use to make the request.
123
+ * @param params - The workspace and extension names.
124
+ * @param fetchOptions - Optional Ky fetch options.
125
+ *
126
+ * @throws A `CommerceSdkValidationError` if the parameters are invalid.
127
+ * @throws An `HTTPError` if the status code is not 2XX (e.g. a 404 if the extension is
128
+ * not registered, or if this Commerce instance's Admin UI SDK module does not expose this route).
129
+ */
130
+ async function refreshExtension(httpClient, params, fetchOptions) {
131
+ const { workspaceName, extensionName } = require_utils.parseOrThrow(RefreshExtensionParamsSchema, params);
132
+ return httpClient.post(`adminuisdk/extension/${workspaceName}/${extensionName}/refresh`, fetchOptions).then((_res) => {});
133
+ }
110
134
 
111
135
  //#endregion
112
136
  //#region source/api/lib/api-client.ts
@@ -36,6 +36,7 @@ declare class AdminUiPermissionDeniedError extends AdminUiPermissionError {
36
36
  declare function createAdminUiApiClient(params: CommerceHttpClientParams): import("@adobe/aio-commerce-lib-api").ApiClientRecord<AdobeCommerceHttpClient, {
37
37
  registerExtension(httpClient: AdobeCommerceHttpClient, params: ExtensionRegistrationParams, fetchOptions?: import("ky").Options): Promise<RegisterExtensionResponse>;
38
38
  unregisterExtension(httpClient: AdobeCommerceHttpClient, params: UnregisterExtensionParams, fetchOptions?: import("ky").Options): Promise<void>;
39
+ refreshExtension(httpClient: AdobeCommerceHttpClient, params: RefreshExtensionParams, fetchOptions?: import("ky").Options): Promise<void>;
39
40
  enableAdminUiSdk(httpClient: AdobeCommerceHttpClient, fetchOptions?: import("ky").Options): Promise<boolean>;
40
41
  }>;
41
42
  /**
@@ -108,10 +109,17 @@ declare const UnregisterExtensionParamsSchema: v.ObjectSchema<{
108
109
  readonly extensionName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
109
110
  readonly workspaceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
110
111
  }, undefined>;
112
+ /** Parameters for POST /V1/adminuisdk/extension/{workspaceName}/{extensionName}/refresh. */
113
+ declare const RefreshExtensionParamsSchema: v.ObjectSchema<{
114
+ readonly extensionName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
115
+ readonly workspaceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
116
+ }, undefined>;
111
117
  /** The parameters accepted by POST /V1/adminuisdk/extension. */
112
118
  type ExtensionRegistrationParams = v.InferInput<typeof ExtensionRegistrationParamsSchema>;
113
119
  /** The parameters accepted by DELETE /V1/adminuisdk/extension/{workspaceName}/{extensionName}. */
114
120
  type UnregisterExtensionParams = v.InferInput<typeof UnregisterExtensionParamsSchema>;
121
+ /** The parameters accepted by POST /V1/adminuisdk/extension/{workspaceName}/{extensionName}/refresh. */
122
+ type RefreshExtensionParams = v.InferInput<typeof RefreshExtensionParamsSchema>;
115
123
  /** The response returned by POST /V1/adminuisdk/extension. */
116
124
  type RegisterExtensionResponse = {
117
125
  extensionId: string;
@@ -125,4 +133,4 @@ declare const permissionCheckResponseSchema: v.ObjectSchema<{
125
133
  /** Parsed Admin UI SDK permission check response. */
126
134
  type PermissionCheckResponse = v.InferOutput<typeof permissionCheckResponseSchema>;
127
135
  //#endregion
128
- export { AdminUiApiClient, type AdminUiEntity, AdminUiPermissionClient, AdminUiPermissionClientOptions, AdminUiPermissionDeniedError, AdminUiPermissionDeniedErrorOptions, AdminUiPermissionError, type ExtensionRegistrationParams, type ExtensionRegistrationParamsSchema, type PermissionCheckResponse, type RegisterExtensionResponse, type UnregisterExtensionParams, type UnregisterExtensionParamsSchema, createAdminUiApiClient, getAclResourceId, getAdminUiPermissionClient, type permissionCheckResponseSchema };
136
+ export { AdminUiApiClient, type AdminUiEntity, AdminUiPermissionClient, AdminUiPermissionClientOptions, AdminUiPermissionDeniedError, AdminUiPermissionDeniedErrorOptions, AdminUiPermissionError, type ExtensionRegistrationParams, type ExtensionRegistrationParamsSchema, type PermissionCheckResponse, type RefreshExtensionParams, type RefreshExtensionParamsSchema, type RegisterExtensionResponse, type UnregisterExtensionParams, type UnregisterExtensionParamsSchema, createAdminUiApiClient, getAclResourceId, getAdminUiPermissionClient, type permissionCheckResponseSchema };
@@ -36,6 +36,7 @@ declare class AdminUiPermissionDeniedError extends AdminUiPermissionError {
36
36
  declare function createAdminUiApiClient(params: CommerceHttpClientParams): import("@adobe/aio-commerce-lib-api").ApiClientRecord<AdobeCommerceHttpClient, {
37
37
  registerExtension(httpClient: AdobeCommerceHttpClient, params: ExtensionRegistrationParams, fetchOptions?: import("ky").Options): Promise<RegisterExtensionResponse>;
38
38
  unregisterExtension(httpClient: AdobeCommerceHttpClient, params: UnregisterExtensionParams, fetchOptions?: import("ky").Options): Promise<void>;
39
+ refreshExtension(httpClient: AdobeCommerceHttpClient, params: RefreshExtensionParams, fetchOptions?: import("ky").Options): Promise<void>;
39
40
  enableAdminUiSdk(httpClient: AdobeCommerceHttpClient, fetchOptions?: import("ky").Options): Promise<boolean>;
40
41
  }>;
41
42
  /**
@@ -108,10 +109,17 @@ declare const UnregisterExtensionParamsSchema: v.ObjectSchema<{
108
109
  readonly extensionName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
109
110
  readonly workspaceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
110
111
  }, undefined>;
112
+ /** Parameters for POST /V1/adminuisdk/extension/{workspaceName}/{extensionName}/refresh. */
113
+ declare const RefreshExtensionParamsSchema: v.ObjectSchema<{
114
+ readonly extensionName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
115
+ readonly workspaceName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
116
+ }, undefined>;
111
117
  /** The parameters accepted by POST /V1/adminuisdk/extension. */
112
118
  type ExtensionRegistrationParams = v.InferInput<typeof ExtensionRegistrationParamsSchema>;
113
119
  /** The parameters accepted by DELETE /V1/adminuisdk/extension/{workspaceName}/{extensionName}. */
114
120
  type UnregisterExtensionParams = v.InferInput<typeof UnregisterExtensionParamsSchema>;
121
+ /** The parameters accepted by POST /V1/adminuisdk/extension/{workspaceName}/{extensionName}/refresh. */
122
+ type RefreshExtensionParams = v.InferInput<typeof RefreshExtensionParamsSchema>;
115
123
  /** The response returned by POST /V1/adminuisdk/extension. */
116
124
  type RegisterExtensionResponse = {
117
125
  extensionId: string;
@@ -125,4 +133,4 @@ declare const permissionCheckResponseSchema: v.ObjectSchema<{
125
133
  /** Parsed Admin UI SDK permission check response. */
126
134
  type PermissionCheckResponse = v.InferOutput<typeof permissionCheckResponseSchema>;
127
135
  //#endregion
128
- export { AdminUiApiClient, type AdminUiEntity, AdminUiPermissionClient, AdminUiPermissionClientOptions, AdminUiPermissionDeniedError, AdminUiPermissionDeniedErrorOptions, AdminUiPermissionError, type ExtensionRegistrationParams, type ExtensionRegistrationParamsSchema, type PermissionCheckResponse, type RegisterExtensionResponse, type UnregisterExtensionParams, type UnregisterExtensionParamsSchema, createAdminUiApiClient, getAclResourceId, getAdminUiPermissionClient, type permissionCheckResponseSchema };
136
+ export { AdminUiApiClient, type AdminUiEntity, AdminUiPermissionClient, AdminUiPermissionClientOptions, AdminUiPermissionDeniedError, AdminUiPermissionDeniedErrorOptions, AdminUiPermissionError, type ExtensionRegistrationParams, type ExtensionRegistrationParamsSchema, type PermissionCheckResponse, type RefreshExtensionParams, type RefreshExtensionParamsSchema, type RegisterExtensionResponse, type UnregisterExtensionParams, type UnregisterExtensionParamsSchema, createAdminUiApiClient, getAclResourceId, getAdminUiPermissionClient, type permissionCheckResponseSchema };
@@ -83,10 +83,16 @@ const UnregisterExtensionParamsSchema = v.object({
83
83
  extensionName: v.pipe(v.string(), v.minLength(1)),
84
84
  workspaceName: v.pipe(v.string(), v.minLength(1))
85
85
  });
86
+ /** Parameters for POST /V1/adminuisdk/extension/{workspaceName}/{extensionName}/refresh. */
87
+ const RefreshExtensionParamsSchema = v.object({
88
+ extensionName: v.pipe(v.string(), v.minLength(1)),
89
+ workspaceName: v.pipe(v.string(), v.minLength(1))
90
+ });
86
91
 
87
92
  //#endregion
88
93
  //#region source/api/extensions/endpoints.ts
89
94
  var endpoints_exports = /* @__PURE__ */ __exportAll({
95
+ refreshExtension: () => refreshExtension,
90
96
  registerExtension: () => registerExtension,
91
97
  unregisterExtension: () => unregisterExtension
92
98
  });
@@ -121,6 +127,24 @@ async function unregisterExtension(httpClient, params, fetchOptions) {
121
127
  const { workspaceName, extensionName } = parseOrThrow(UnregisterExtensionParamsSchema, params);
122
128
  return httpClient.delete(`adminuisdk/extension/${workspaceName}/${extensionName}`, fetchOptions).then((_res) => {});
123
129
  }
130
+ /**
131
+ * Refreshes an existing Admin UI extension's registrations from the App Registry via
132
+ * POST /V1/adminuisdk/extension/{workspaceName}/{extensionName}/refresh. Unlike
133
+ * {@link registerExtension}, this does not modify the extension record itself — it only
134
+ * re-syncs its registrations.
135
+ *
136
+ * @param httpClient - The {@link AdobeCommerceHttpClient} to use to make the request.
137
+ * @param params - The workspace and extension names.
138
+ * @param fetchOptions - Optional Ky fetch options.
139
+ *
140
+ * @throws A `CommerceSdkValidationError` if the parameters are invalid.
141
+ * @throws An `HTTPError` if the status code is not 2XX (e.g. a 404 if the extension is
142
+ * not registered, or if this Commerce instance's Admin UI SDK module does not expose this route).
143
+ */
144
+ async function refreshExtension(httpClient, params, fetchOptions) {
145
+ const { workspaceName, extensionName } = parseOrThrow(RefreshExtensionParamsSchema, params);
146
+ return httpClient.post(`adminuisdk/extension/${workspaceName}/${extensionName}/refresh`, fetchOptions).then((_res) => {});
147
+ }
124
148
 
125
149
  //#endregion
126
150
  //#region source/api/lib/api-client.ts
package/package.json CHANGED
@@ -1,13 +1,7 @@
1
1
  {
2
2
  "name": "@adobe/aio-commerce-lib-admin-ui",
3
- "type": "module",
4
- "author": "Adobe Inc.",
5
- "version": "1.0.1",
3
+ "version": "1.1.0-beta-20260820174436",
6
4
  "private": false,
7
- "engines": {
8
- "node": ">=22 <=24"
9
- },
10
- "license": "Apache-2.0",
11
5
  "description": "A library to interact with the Adobe Commerce Admin UI SDK API",
12
6
  "keywords": [
13
7
  "aio",
@@ -27,9 +21,15 @@
27
21
  "url": "git+https://github.com/adobe/aio-commerce-sdk.git",
28
22
  "directory": "packages/aio-commerce-lib-admin-ui"
29
23
  },
30
- "publishConfig": {
31
- "registry": "https://registry.npmjs.org",
32
- "access": "public"
24
+ "license": "Apache-2.0",
25
+ "author": "Adobe Inc.",
26
+ "sideEffects": false,
27
+ "type": "module",
28
+ "imports": {
29
+ "#*": "./source/*.ts",
30
+ "#*.tsx": "./source/*.tsx",
31
+ "#test/*": "./test/*.ts",
32
+ "#test/*.tsx": "./test/*.tsx"
33
33
  },
34
34
  "exports": {
35
35
  "./api": {
@@ -94,12 +94,6 @@
94
94
  },
95
95
  "./package.json": "./package.json"
96
96
  },
97
- "imports": {
98
- "#*": "./source/*.ts",
99
- "#*.tsx": "./source/*.tsx",
100
- "#test/*": "./test/*.ts",
101
- "#test/*.tsx": "./test/*.tsx"
102
- },
103
97
  "files": [
104
98
  "dist",
105
99
  "package.json",
@@ -116,6 +110,21 @@
116
110
  "@adobe/aio-commerce-lib-api": "1.3.1",
117
111
  "@adobe/aio-commerce-lib-core": "1.2.0"
118
112
  },
113
+ "devDependencies": {
114
+ "@react-spectrum/s2": "^1.5.1",
115
+ "@types/react": "^19.2.17",
116
+ "@types/react-dom": "^19.2.3",
117
+ "react": "^19.2.7",
118
+ "react-dom": "^19.2.7",
119
+ "typescript": "^6.0.0",
120
+ "@aio-commerce-sdk/config-tsdown": "1.0.1",
121
+ "@aio-commerce-sdk/config-typedoc": "1.0.0",
122
+ "@aio-commerce-sdk/common-utils": "0.2.6",
123
+ "@aio-commerce-sdk/config-typescript": "1.0.0",
124
+ "@aio-commerce-sdk/config-vitest": "1.0.0",
125
+ "@aio-commerce-sdk/scripting-utils": "0.3.5",
126
+ "@aio-commerce-sdk/scripts": "0.1.1"
127
+ },
119
128
  "peerDependencies": {
120
129
  "@react-spectrum/s2": "^1.5.1",
121
130
  "react": "^19.2.7",
@@ -132,39 +141,30 @@
132
141
  "optional": true
133
142
  }
134
143
  },
135
- "devDependencies": {
136
- "@react-spectrum/s2": "^1.5.1",
137
- "@types/react": "^19.2.17",
138
- "@types/react-dom": "^19.2.3",
139
- "react": "^19.2.7",
140
- "react-dom": "^19.2.7",
141
- "typescript": "^6.0.0",
142
- "@aio-commerce-sdk/common-utils": "0.2.6",
143
- "@aio-commerce-sdk/config-tsdown": "1.0.1",
144
- "@aio-commerce-sdk/config-typedoc": "1.0.0",
145
- "@aio-commerce-sdk/config-typescript": "1.0.0",
146
- "@aio-commerce-sdk/config-vitest": "1.0.0",
147
- "@aio-commerce-sdk/scripting-utils": "0.3.5",
148
- "@aio-commerce-sdk/scripts": "0.1.1"
144
+ "engines": {
145
+ "node": ">=22 <=24"
146
+ },
147
+ "publishConfig": {
148
+ "access": "public",
149
+ "registry": "https://registry.npmjs.org"
149
150
  },
150
- "sideEffects": false,
151
151
  "scripts": {
152
- "publint": "publint",
153
- "build": "tsdown",
154
- "docs": "typedoc && prettier --write '**/*.md'",
155
- "pack": "pnpm pack",
156
152
  "assist": "biome check --formatter-enabled=false --linter-enabled=false --assist-enabled=true --no-errors-on-unmatched",
157
153
  "assist:apply": "biome check --write --formatter-enabled=false --linter-enabled=false --assist-enabled=true --no-errors-on-unmatched",
154
+ "build": "tsdown",
158
155
  "check:ci": "biome ci --formatter-enabled=true --linter-enabled=true --assist-enabled=true --no-errors-on-unmatched",
159
156
  "code:fix": "pnpm run lint:fix && pnpm run assist:apply && pnpm run format && pnpm run format:markdown",
157
+ "docs": "typedoc && prettier --write '**/*.md'",
160
158
  "format": "biome format --write --no-errors-on-unmatched",
161
- "format:markdown": "prettier --no-error-on-unmatched-pattern --write '**/*.md' \"!**/{CODE_OF_CONDUCT.md,COPYRIGHT,LICENSE,SECURITY.md,CONTRIBUTING.md}\"",
162
159
  "format:check": "biome format --no-errors-on-unmatched",
160
+ "format:markdown": "prettier --no-error-on-unmatched-pattern --write '**/*.md' \"!**/{CODE_OF_CONDUCT.md,COPYRIGHT,LICENSE,SECURITY.md,CONTRIBUTING.md}\"",
163
161
  "lint": "biome lint --no-errors-on-unmatched",
164
162
  "lint:fix": "biome lint --write --no-errors-on-unmatched",
165
- "typecheck": "tsc --noEmit && echo '✅ No type errors found.'",
163
+ "pack": "pnpm pack",
164
+ "publint": "publint",
166
165
  "test": "vitest run --coverage",
167
166
  "test:ui": "vitest --ui --coverage",
168
- "test:watch": "vitest --watch --coverage"
167
+ "test:watch": "vitest --watch --coverage",
168
+ "typecheck": "tsc --noEmit && echo '✅ No type errors found.'"
169
169
  }
170
170
  }