@adobe/aio-commerce-lib-app 1.8.0 → 1.9.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/actions/app-config/index.cjs +3 -3
  3. package/dist/cjs/actions/app-config/index.d.cts +2 -2
  4. package/dist/cjs/actions/association/index.d.cts +0 -1
  5. package/dist/cjs/actions/config/index.d.cts +1 -1
  6. package/dist/cjs/actions/installation/index.cjs +2 -2
  7. package/dist/cjs/actions/installation/index.d.cts +3 -3
  8. package/dist/cjs/{app-BwehWeu1.d.cts → app-e4bCHpek.d.cts} +0 -1
  9. package/dist/cjs/commands/index.cjs +8 -8
  10. package/dist/cjs/commands/index.d.cts +1 -1
  11. package/dist/cjs/config/index.browser.d.cts +1 -1
  12. package/dist/cjs/config/index.node.cjs +3 -3
  13. package/dist/cjs/config/index.node.d.cts +3 -13
  14. package/dist/{es/define-DxH1BFia.d.mts → cjs/define-B__VyRtO.d.cts} +1 -2
  15. package/dist/{es/index-B0XqHwY5.d.mts → cjs/index-DWEigxhy.d.cts} +3 -1
  16. package/dist/{es/index-DSk-RmwM.d.mts → cjs/index-Ds7AyoNv.d.cts} +139 -64
  17. package/dist/cjs/index.cjs +1 -1
  18. package/dist/cjs/index.d.cts +3 -2
  19. package/dist/cjs/{index.node-BWZuZLgs.cjs → index.node-Bv_FUgST.cjs} +1 -1
  20. package/dist/cjs/management/index.cjs +1 -1
  21. package/dist/cjs/management/index.d.cts +1 -1
  22. package/dist/cjs/{management-DEsRVP2L.cjs → management-DmH7fVxy.cjs} +4 -2
  23. package/dist/cjs/{openapi-C36q3dCZ.cjs → openapi-BzRN5Lc6.cjs} +1 -1
  24. package/dist/cjs/{utils-DSCmZ_iJ.cjs → utils-CGZGfXuy.cjs} +25 -0
  25. package/dist/cjs/{validate-C_eCKp21.cjs → validate-Dt0Fdj1L.cjs} +1 -1
  26. package/dist/cjs/{webhooks-L4DWHSOl.cjs → webhooks-CrHGA-sO.cjs} +0 -2
  27. package/dist/es/actions/app-config/index.d.mts +2 -2
  28. package/dist/es/actions/app-config/index.mjs +3 -3
  29. package/dist/es/actions/association/index.d.mts +0 -1
  30. package/dist/es/actions/config/index.d.mts +1 -1
  31. package/dist/es/actions/installation/index.d.mts +3 -3
  32. package/dist/es/actions/installation/index.mjs +2 -2
  33. package/dist/es/{app-BwehWeu1.d.mts → app-e4bCHpek.d.mts} +0 -1
  34. package/dist/es/commands/index.d.mts +1 -1
  35. package/dist/es/commands/index.mjs +7 -7
  36. package/dist/es/config/index.browser.d.mts +1 -1
  37. package/dist/es/config/index.node.d.mts +3 -14
  38. package/dist/es/config/index.node.mjs +3 -3
  39. package/dist/{cjs/define-DOqVyexT.d.cts → es/define-BEY_Q6rS.d.mts} +1 -2
  40. package/dist/{cjs/index-BXm8UbK7.d.cts → es/index-CgsSXApi.d.mts} +4 -1
  41. package/dist/{cjs/index-B3ISkC54.d.cts → es/index-Dsg4LZde.d.mts} +139 -64
  42. package/dist/es/index.d.mts +3 -2
  43. package/dist/es/index.mjs +1 -1
  44. package/dist/es/{index.node-DuvW9Sha.mjs → index.node-DsJ0QRGh.mjs} +1 -1
  45. package/dist/es/management/index.d.mts +1 -1
  46. package/dist/es/management/index.mjs +1 -1
  47. package/dist/es/{management-D5pmBBec.mjs → management-BpFkwoig.mjs} +4 -2
  48. package/dist/es/{openapi-BSc2NRd2.mjs → openapi-QEV7W6DH.mjs} +1 -1
  49. package/dist/es/{utils-_gj8L6eN.mjs → utils-D0O4r9jr.mjs} +20 -1
  50. package/dist/es/{validate-t0T0F2MF.mjs → validate-yqa8uIyb.mjs} +1 -1
  51. package/dist/es/{webhooks-D7DExIDM.mjs → webhooks-CVbZOxYS.mjs} +0 -2
  52. package/package.json +3 -3
@@ -23,7 +23,7 @@ var info = {
23
23
  "identifier": "Apache-2.0",
24
24
  "name": "Apache-2.0"
25
25
  },
26
- "x-meta": { "packageVersion": "1.8.0" }
26
+ "x-meta": { "packageVersion": "1.9.0" }
27
27
  };
28
28
  var servers = [{ "url": "/" }];
29
29
  var paths = {
@@ -12,6 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
+ import { getSystemConfigByKey, setSystemConfigByKey } from "@adobe/aio-commerce-lib-config";
15
16
  import { resolveAuthParams } from "@adobe/aio-commerce-lib-auth";
16
17
 
17
18
  //#region source/management/installation/events/utils.ts
@@ -26,6 +27,24 @@ const METADATA_ID_MAX_LENGTH_FOR_INSTANCE_ID = 100;
26
27
  /** Storage key used for the events installation data in system config. */
27
28
  const EVENTS_STORAGE_KEY = "events";
28
29
  /**
30
+ * Removes event providers from installation storage.
31
+ *
32
+ * @param providerKeys - The provider keys to remove.
33
+ */
34
+ async function removeStoredEventProviders(providerKeys) {
35
+ if (providerKeys.length === 0) return;
36
+ const existing = await getSystemConfigByKey(EVENTS_STORAGE_KEY);
37
+ if (!existing) return;
38
+ const providerKeysToRemove = new Set(providerKeys);
39
+ if (!providerKeys.some((key) => Object.hasOwn(existing.providers, key))) return;
40
+ const providers = Object.fromEntries(Object.entries(existing.providers).filter(([key]) => !providerKeysToRemove.has(key)));
41
+ if (Object.keys(providers).length === 0) {
42
+ await setSystemConfigByKey(EVENTS_STORAGE_KEY, null);
43
+ return;
44
+ }
45
+ await setSystemConfigByKey(EVENTS_STORAGE_KEY, { providers });
46
+ }
47
+ /**
29
48
  * Generates a unique instance ID for I/O Events for this app deployment.
30
49
  * Uses `{metadata.id (first 100 chars)}-{providerKeyOrSlug}-{workspaceId}` (lowercased).
31
50
  *
@@ -286,4 +305,4 @@ async function getCommerceEventingExistingData(context) {
286
305
  }
287
306
 
288
307
  //#endregion
289
- export { getRegistrationName as _, findExistingProviderMetadata as a, sanitizeEventingIdentifier as b, generateInstanceId as c, getCommerceEventingExistingData as d, getIoEventCode as f, getRegistrationDescription as g, getNamespacedEvent as h, findExistingProvider as i, generateInstanceIdDeprecated as l, getLegacyRegistrationName as m, EVENTS_STORAGE_KEY as n, findExistingRegistrations as o, getIoEventsExistingData as p, EXTERNAL_PROVIDER_TYPE as r, findExistingSubscription as s, COMMERCE_PROVIDER_TYPE as t, getCommerceEventingConfigurationUpdateParams as u, groupEventsByRuntimeActions as v, makeWorkspaceConfig as y };
308
+ export { getRegistrationName as _, findExistingProviderMetadata as a, removeStoredEventProviders as b, generateInstanceId as c, getCommerceEventingExistingData as d, getIoEventCode as f, getRegistrationDescription as g, getNamespacedEvent as h, findExistingProvider as i, generateInstanceIdDeprecated as l, getLegacyRegistrationName as m, EVENTS_STORAGE_KEY as n, findExistingRegistrations as o, getIoEventsExistingData as p, EXTERNAL_PROVIDER_TYPE as r, findExistingSubscription as s, COMMERCE_PROVIDER_TYPE as t, getCommerceEventingConfigurationUpdateParams as u, groupEventsByRuntimeActions as v, sanitizeEventingIdentifier as x, makeWorkspaceConfig as y };
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  import { t as alphaNumericOrHyphenSchema } from "./schemas-hRovglBF.mjs";
16
- import { a as hasCustomInstallationSteps, d as hasAdminUi, i as hasCustomInstallation, l as hasExternalEvents, n as hasWebhooks, o as EventingSchema, r as InstallationSchema, s as hasCommerceEvents, t as WebhooksSchema, u as AdminUiSchema } from "./webhooks-D7DExIDM.mjs";
16
+ import { a as hasCustomInstallationSteps, d as hasAdminUi, i as hasCustomInstallation, l as hasExternalEvents, n as hasWebhooks, o as EventingSchema, r as InstallationSchema, s as hasCommerceEvents, t as WebhooksSchema, u as AdminUiSchema } from "./webhooks-CVbZOxYS.mjs";
17
17
  import { SchemaBusinessConfig } from "@adobe/aio-commerce-lib-config";
18
18
  import { CommerceSdkValidationError } from "@adobe/aio-commerce-lib-core/error";
19
19
  import * as v from "valibot";
@@ -151,7 +151,6 @@ const MenuSchema = v.object({
151
151
  /**
152
152
  * Schema for the `adminUi` config section.
153
153
  * Supports grid column extensions, mass actions, order view buttons, and menu on `commerce/backend-ui/2`.
154
- * @experimental
155
154
  */
156
155
  const AdminUiSchema = v.object({
157
156
  customer: v.optional(AdminUiCustomerSchema),
@@ -161,7 +160,6 @@ const AdminUiSchema = v.object({
161
160
  });
162
161
  /**
163
162
  * Check if config has Admin UI configuration.
164
- * @experimental
165
163
  */
166
164
  function hasAdminUi(config) {
167
165
  return config.adminUi !== void 0;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@adobe/aio-commerce-lib-app",
3
3
  "type": "module",
4
4
  "author": "Adobe Inc.",
5
- "version": "1.8.0",
5
+ "version": "1.9.0",
6
6
  "private": false,
7
7
  "engines": {
8
8
  "node": ">=22 <=24"
@@ -121,11 +121,11 @@
121
121
  "type-fest": "^5.0.0",
122
122
  "valibot": "^1.1.0",
123
123
  "yaml": "^2.8.1",
124
- "@adobe/aio-commerce-lib-admin-ui": "0.2.0",
124
+ "@adobe/aio-commerce-lib-admin-ui": "1.0.0",
125
125
  "@adobe/aio-commerce-lib-api": "1.3.0",
126
126
  "@adobe/aio-commerce-lib-auth": "1.1.2",
127
- "@adobe/aio-commerce-lib-config": "1.6.0",
128
127
  "@adobe/aio-commerce-lib-core": "1.2.0",
128
+ "@adobe/aio-commerce-lib-config": "1.6.0",
129
129
  "@adobe/aio-commerce-lib-events": "1.3.0",
130
130
  "@adobe/aio-commerce-lib-webhooks": "1.2.0"
131
131
  },