@adobe/aio-commerce-lib-auth 1.0.0 → 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.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/{chunk-C0xms8kb.cjs → chunk-DS2yp5vX.cjs} +14 -0
- package/dist/cjs/commands/index.cjs +15 -1
- package/dist/cjs/commands/index.d.cts +14 -0
- package/dist/cjs/index.cjs +17 -2
- package/dist/cjs/index.d.cts +35 -1
- package/dist/es/commands/index.d.mts +14 -0
- package/dist/es/commands/index.mjs +14 -0
- package/dist/es/index.d.mts +35 -1
- package/dist/es/index.mjs +15 -1
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @adobe/aio-commerce-lib-auth
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#343](https://github.com/adobe/aio-commerce-sdk/pull/343) [`4883afa`](https://github.com/adobe/aio-commerce-sdk/commit/4883afaec90451cd7daf280f0def83ea45a3c87c) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Export `resolveImsAuthParams` utility
|
|
8
|
+
|
|
3
9
|
## 1.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
|
@@ -1,3 +1,17 @@
|
|
|
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
|
//#region \0rolldown/runtime.js
|
|
2
16
|
var __create = Object.create;
|
|
3
17
|
var __defProp = Object.defineProperty;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const require_chunk = require('../chunk-DS2yp5vX.cjs');
|
|
3
17
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
|
4
18
|
let _adobe_aio_lib_ims = require("@adobe/aio-lib-ims");
|
|
5
19
|
_adobe_aio_lib_ims = require_chunk.__toESM(_adobe_aio_lib_ims);
|
|
@@ -1 +1,15 @@
|
|
|
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
|
export { };
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,5 +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
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_chunk = require('./chunk-
|
|
16
|
+
const require_chunk = require('./chunk-DS2yp5vX.cjs');
|
|
3
17
|
let _adobe_aio_commerce_lib_core_headers = require("@adobe/aio-commerce-lib-core/headers");
|
|
4
18
|
let valibot = require("valibot");
|
|
5
19
|
valibot = require_chunk.__toESM(valibot);
|
|
@@ -747,4 +761,5 @@ exports.getImsAuthProvider = getImsAuthProvider;
|
|
|
747
761
|
exports.getIntegrationAuthProvider = getIntegrationAuthProvider;
|
|
748
762
|
exports.isImsAuthProvider = isImsAuthProvider;
|
|
749
763
|
exports.isIntegrationAuthProvider = isIntegrationAuthProvider;
|
|
750
|
-
exports.resolveAuthParams = resolveAuthParams;
|
|
764
|
+
exports.resolveAuthParams = resolveAuthParams;
|
|
765
|
+
exports.resolveImsAuthParams = resolveImsAuthParams;
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
17
|
|
|
@@ -241,6 +255,26 @@ declare function getImsAuthProvider(authParams: ImsAuthParams): {
|
|
|
241
255
|
* ```
|
|
242
256
|
*/
|
|
243
257
|
declare function assertImsAuthParams(config: Record<PropertyKey, unknown>): asserts config is ImsAuthParams;
|
|
258
|
+
/**
|
|
259
|
+
* Resolves an {@link ImsAuthParams} from the given App Builder action inputs.
|
|
260
|
+
* @param params The App Builder action inputs to resolve the IMS authentication parameters from.
|
|
261
|
+
* @throws {CommerceSdkValidationError} If the parameters are invalid and cannot be resolved.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```typescript
|
|
265
|
+
* // Some App Builder runtime action that needs IMS authentication
|
|
266
|
+
* export function main(params) {
|
|
267
|
+
* const imsAuthProvider = getImsAuthProvider(resolveImsAuthParams(params));
|
|
268
|
+
*
|
|
269
|
+
* // Get headers for API requests
|
|
270
|
+
* const headers = await authProvider.getHeaders();
|
|
271
|
+
* const response = await fetch('https://api.adobe.io/some-endpoint', {
|
|
272
|
+
* headers: await authProvider.getHeaders()
|
|
273
|
+
* });
|
|
274
|
+
* }
|
|
275
|
+
* ```
|
|
276
|
+
*/
|
|
277
|
+
declare function resolveImsAuthParams(params: Record<string, unknown>): ImsAuthParams;
|
|
244
278
|
//#endregion
|
|
245
279
|
//#region source/lib/integration-auth/schema.d.ts
|
|
246
280
|
/**
|
|
@@ -386,4 +420,4 @@ declare function resolveAuthParams(params: Record<string, unknown>): {
|
|
|
386
420
|
accessTokenSecret: string;
|
|
387
421
|
};
|
|
388
422
|
//#endregion
|
|
389
|
-
export { type ForwardedImsAuthSource, type ImsAuthEnv, type ImsAuthHeaders, type ImsAuthParams, type ImsAuthProvider, type IntegrationAuthParams, type IntegrationAuthProvider, assertImsAuthParams, assertIntegrationAuthParams, forwardImsAuthProvider, getForwardedImsAuthProvider, getImsAuthProvider, getIntegrationAuthProvider, isImsAuthProvider, isIntegrationAuthProvider, resolveAuthParams };
|
|
423
|
+
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 };
|
|
@@ -1 +1,15 @@
|
|
|
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
|
export { };
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
2
16
|
import { CommerceSdkValidationError } from "@adobe/aio-commerce-lib-core/error";
|
|
3
17
|
import aioLibIms from "@adobe/aio-lib-ims";
|
|
4
18
|
import consola from "consola";
|
package/dist/es/index.d.mts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
17
|
//#region source/lib/ims-auth/types.d.ts
|
|
@@ -240,6 +254,26 @@ declare function getImsAuthProvider(authParams: ImsAuthParams): {
|
|
|
240
254
|
* ```
|
|
241
255
|
*/
|
|
242
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;
|
|
243
277
|
//#endregion
|
|
244
278
|
//#region source/lib/integration-auth/schema.d.ts
|
|
245
279
|
/**
|
|
@@ -385,4 +419,4 @@ declare function resolveAuthParams(params: Record<string, unknown>): {
|
|
|
385
419
|
accessTokenSecret: string;
|
|
386
420
|
};
|
|
387
421
|
//#endregion
|
|
388
|
-
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 };
|
package/dist/es/index.mjs
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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 { createHeaderAccessor, getHeader, getHeadersFromParams, parseBearerToken } from "@adobe/aio-commerce-lib-core/headers";
|
|
2
16
|
import * as v from "valibot";
|
|
3
17
|
import { array, email, instance, minLength, nonEmpty, nonOptional, object, optional, parse, picklist, pipe, rawTransform, safeParse, string, transform, union, url } from "valibot";
|
|
@@ -734,4 +748,4 @@ function resolveAuthParams(params) {
|
|
|
734
748
|
}
|
|
735
749
|
|
|
736
750
|
//#endregion
|
|
737
|
-
export { assertImsAuthParams, assertIntegrationAuthParams, forwardImsAuthProvider, getForwardedImsAuthProvider, getImsAuthProvider, getIntegrationAuthProvider, isImsAuthProvider, isIntegrationAuthProvider, resolveAuthParams };
|
|
751
|
+
export { assertImsAuthParams, assertIntegrationAuthParams, forwardImsAuthProvider, getForwardedImsAuthProvider, getImsAuthProvider, getIntegrationAuthProvider, isImsAuthProvider, isIntegrationAuthProvider, resolveAuthParams, resolveImsAuthParams };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@adobe/aio-commerce-lib-auth",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Adobe Inc.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.1",
|
|
6
6
|
"private": false,
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20 <=24"
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"@adobe/aio-commerce-lib-core": "1.0.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"typescript": "^5.9.
|
|
74
|
+
"typescript": "^5.9.3",
|
|
75
75
|
"@aio-commerce-sdk/config-tsdown": "1.0.1",
|
|
76
76
|
"@aio-commerce-sdk/config-typedoc": "1.0.0",
|
|
77
77
|
"@aio-commerce-sdk/config-typescript": "1.0.0",
|
|
78
78
|
"@aio-commerce-sdk/config-vitest": "1.0.0",
|
|
79
|
-
"@aio-commerce-sdk/common-utils": "0.2.
|
|
80
|
-
"@aio-commerce-sdk/scripting-utils": "0.
|
|
81
|
-
"@aio-commerce-sdk/scripts": "0.0
|
|
79
|
+
"@aio-commerce-sdk/common-utils": "0.2.3",
|
|
80
|
+
"@aio-commerce-sdk/scripting-utils": "0.3.0",
|
|
81
|
+
"@aio-commerce-sdk/scripts": "0.1.0"
|
|
82
82
|
},
|
|
83
83
|
"sideEffects": false,
|
|
84
84
|
"scripts": {
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"assist": "biome check --formatter-enabled=false --linter-enabled=false --assist-enabled=true --no-errors-on-unmatched",
|
|
90
90
|
"assist:apply": "biome check --write --formatter-enabled=false --linter-enabled=false --assist-enabled=true --no-errors-on-unmatched",
|
|
91
91
|
"check:ci": "biome ci --formatter-enabled=true --linter-enabled=true --assist-enabled=true --no-errors-on-unmatched",
|
|
92
|
+
"code:fix": "pnpm run lint:fix && pnpm run assist:apply && pnpm run format && pnpm run format:markdown",
|
|
92
93
|
"format": "biome format --write --no-errors-on-unmatched",
|
|
93
94
|
"format:markdown": "prettier --no-error-on-unmatched-pattern --write '**/*.md' \"!**/{CODE_OF_CONDUCT.md,COPYRIGHT,LICENSE,SECURITY.md,CONTRIBUTING.md}\"",
|
|
94
95
|
"format:check": "biome format --no-errors-on-unmatched",
|