@adobe/aio-commerce-lib-auth 0.8.1 → 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.
@@ -1,7 +1,19 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright 2026 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+
1
15
  import * as v from "valibot";
2
16
  import { InferOutput } from "valibot";
3
- import "@adobe/aio-commerce-lib-core/params";
4
-
5
17
  //#region source/lib/ims-auth/types.d.ts
6
18
  /** Defines the headers required for IMS authentication. */
7
19
  type ImsAuthHeaders = {
@@ -242,6 +254,26 @@ declare function getImsAuthProvider(authParams: ImsAuthParams): {
242
254
  * ```
243
255
  */
244
256
  declare function assertImsAuthParams(config: Record<PropertyKey, unknown>): asserts config is ImsAuthParams;
257
+ /**
258
+ * Resolves an {@link ImsAuthParams} from the given App Builder action inputs.
259
+ * @param params The App Builder action inputs to resolve the IMS authentication parameters from.
260
+ * @throws {CommerceSdkValidationError} If the parameters are invalid and cannot be resolved.
261
+ *
262
+ * @example
263
+ * ```typescript
264
+ * // Some App Builder runtime action that needs IMS authentication
265
+ * export function main(params) {
266
+ * const imsAuthProvider = getImsAuthProvider(resolveImsAuthParams(params));
267
+ *
268
+ * // Get headers for API requests
269
+ * const headers = await authProvider.getHeaders();
270
+ * const response = await fetch('https://api.adobe.io/some-endpoint', {
271
+ * headers: await authProvider.getHeaders()
272
+ * });
273
+ * }
274
+ * ```
275
+ */
276
+ declare function resolveImsAuthParams(params: Record<string, unknown>): ImsAuthParams;
245
277
  //#endregion
246
278
  //#region source/lib/integration-auth/schema.d.ts
247
279
  /**
@@ -387,4 +419,4 @@ declare function resolveAuthParams(params: Record<string, unknown>): {
387
419
  accessTokenSecret: string;
388
420
  };
389
421
  //#endregion
390
- export { type ForwardedImsAuthSource, type ImsAuthEnv, type ImsAuthHeaders, type ImsAuthParams, type ImsAuthProvider, type IntegrationAuthParams, type IntegrationAuthProvider, assertImsAuthParams, assertIntegrationAuthParams, forwardImsAuthProvider, getForwardedImsAuthProvider, getImsAuthProvider, getIntegrationAuthProvider, isImsAuthProvider, isIntegrationAuthProvider, resolveAuthParams };
422
+ export { type ForwardedImsAuthSource, type ImsAuthEnv, type ImsAuthHeaders, type ImsAuthParams, type ImsAuthProvider, type IntegrationAuthParams, type IntegrationAuthProvider, assertImsAuthParams, assertIntegrationAuthParams, forwardImsAuthProvider, getForwardedImsAuthProvider, getImsAuthProvider, getIntegrationAuthProvider, isImsAuthProvider, isIntegrationAuthProvider, resolveAuthParams, resolveImsAuthParams };