@adobe/aio-commerce-lib-core 1.4.0 → 1.4.1-beta-20261202103723
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/commerce/index.cjs +1 -1
- package/dist/cjs/error/index.cjs +1 -1
- package/dist/cjs/{error-D892zgDO.cjs → error-B-Jtn1Kf.cjs} +3 -3
- package/dist/cjs/headers/index.cjs +8 -10
- package/dist/cjs/headers/index.d.cts +4 -2
- package/dist/cjs/{rolldown-runtime-CoOt0iuZ.cjs → rolldown-runtime-BKfnhsn2.cjs} +4 -4
- package/dist/es/error/index.mjs +1 -1
- package/dist/es/{error-DHfBWC_D.mjs → error-DTWSjf_4.mjs} +1 -1
- package/dist/es/headers/index.d.mts +4 -2
- package/dist/es/headers/index.mjs +7 -9
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @adobe/aio-commerce-lib-core
|
|
2
2
|
|
|
3
|
+
## 1.4.1-beta-20261202103723
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#820](https://github.com/adobe/aio-commerce-sdk/pull/820) [`5763fae`](https://github.com/adobe/aio-commerce-sdk/commit/5763faeac0546809a4e468d23d2dab320a75d1ca) Thanks [@renovate](https://github.com/apps/renovate)! - Fix inferred header accessor keys for header names containing digits so they match the runtime keys.
|
|
8
|
+
|
|
3
9
|
## 1.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_rolldown_runtime = require("../rolldown-runtime-
|
|
16
|
+
const require_rolldown_runtime = require("../rolldown-runtime-BKfnhsn2.cjs");
|
|
17
17
|
let valibot = require("valibot");
|
|
18
18
|
valibot = require_rolldown_runtime.__toESM(valibot, 1);
|
|
19
19
|
|
package/dist/cjs/error/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_error = require("../error-
|
|
16
|
+
const require_error = require("../error-B-Jtn1Kf.cjs");
|
|
17
17
|
|
|
18
18
|
exports.CommerceSdkErrorBase = require_error.CommerceSdkErrorBase;
|
|
19
19
|
exports.CommerceSdkValidationError = require_error.CommerceSdkValidationError;
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
16
|
-
let valibot = require("valibot");
|
|
15
|
+
const require_rolldown_runtime = require("./rolldown-runtime-BKfnhsn2.cjs");
|
|
17
16
|
let util = require("util");
|
|
18
|
-
util = require_rolldown_runtime.__toESM(util, 1);
|
|
19
17
|
let ansis = require("ansis");
|
|
18
|
+
let valibot = require("valibot");
|
|
19
|
+
util = require_rolldown_runtime.__toESM(util, 1);
|
|
20
20
|
|
|
21
21
|
// source/error/base-error.ts
|
|
22
22
|
/**
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_rolldown_runtime = require("../rolldown-runtime-
|
|
17
|
-
const require_error = require("../error-D892zgDO.cjs");
|
|
18
|
-
let valibot = require("valibot");
|
|
16
|
+
const require_rolldown_runtime = require("../rolldown-runtime-BKfnhsn2.cjs");
|
|
19
17
|
let camelcase = require("camelcase");
|
|
18
|
+
let valibot = require("valibot");
|
|
19
|
+
const require_error = require("../error-B-Jtn1Kf.cjs");
|
|
20
20
|
camelcase = require_rolldown_runtime.__toESM(camelcase, 1);
|
|
21
21
|
|
|
22
22
|
// source/headers/camelcase.ts
|
|
@@ -229,14 +229,12 @@ const LEADING_UNDERSCORES = /^_+/u;
|
|
|
229
229
|
/**
|
|
230
230
|
* Converts a header name to a camelCase key aligned with `type-fest`'s `CamelCase` type.
|
|
231
231
|
*
|
|
232
|
-
*
|
|
233
|
-
* `
|
|
234
|
-
* (e.g. `_foo_bar` → `fooBar`). Without stripping them first, runtime keys would diverge
|
|
235
|
-
* from the inferred TypeScript type.
|
|
232
|
+
* Leading underscores are dropped (e.g. `_foo_bar` → `fooBar`), matching
|
|
233
|
+
* `HttpHeaderAccessorMap`, which sets `preserveLeadingUnderscores: false`.
|
|
236
234
|
*
|
|
237
|
-
* @remarks
|
|
238
|
-
*
|
|
239
|
-
*
|
|
235
|
+
* @remarks Preserving leading underscores (a bare `camelcase(header)` call, which is the
|
|
236
|
+
* default for both `camelcase` v9+ and `type-fest` v6+) is a breaking change and must land
|
|
237
|
+
* in a major release, updating this function and `HttpHeaderAccessorMap` together.
|
|
240
238
|
*/
|
|
241
239
|
function toHeaderCamelKey(header) {
|
|
242
240
|
return camelcase$1(header.replace(LEADING_UNDERSCORES, ""));
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* This module exports core HTTP header utilities for the AIO Commerce SDK.
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
|
-
import { RuntimeActionParams } from "../params/index.cjs";
|
|
21
20
|
import { CamelCase } from "type-fest";
|
|
21
|
+
import { RuntimeActionParams } from "../params/index.cjs";
|
|
22
22
|
/** The type of an HTTP header value. */
|
|
23
23
|
type HttpHeaderValue = string | string[] | undefined;
|
|
24
24
|
/** The type of an HTTP headers record. */
|
|
@@ -38,7 +38,9 @@ type GetHeaderReturn<T extends GetHeaderOptions | undefined> = T extends {
|
|
|
38
38
|
splitCommaSeparated: true;
|
|
39
39
|
} ? HttpHeaderValue : Exclude<HttpHeaderValue, string[]>;
|
|
40
40
|
/** The type of an HTTP header accessor object. */
|
|
41
|
-
type HttpHeaderAccessorMap<T extends string[], O extends GetHeaderOptions | undefined = undefined> = { [K in T[number] as CamelCase<K
|
|
41
|
+
type HttpHeaderAccessorMap<T extends string[], O extends GetHeaderOptions | undefined = undefined> = { [K in T[number] as CamelCase<K, {
|
|
42
|
+
preserveLeadingUnderscores: false;
|
|
43
|
+
}>]: Exclude<GetHeaderReturn<O>, undefined>; };
|
|
42
44
|
/**
|
|
43
45
|
* Creates a type-safe header accessor object with validated required headers.
|
|
44
46
|
* Header names are normalized to camelCase for consistent access.
|
|
@@ -21,12 +21,12 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
21
21
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
22
22
|
var __copyProps = (to, from, except, desc) => {
|
|
23
23
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
-
for (
|
|
25
|
-
key = keys[i];
|
|
24
|
+
for (let key of __getOwnPropNames(from)) {
|
|
26
25
|
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
26
|
+
desc = __getOwnPropDesc(from, key);
|
|
27
27
|
__defProp(to, key, {
|
|
28
|
-
get: (
|
|
29
|
-
enumerable: !
|
|
28
|
+
get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
|
|
29
|
+
enumerable: !desc || desc.enumerable
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}
|
package/dist/es/error/index.mjs
CHANGED
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { n as CommerceSdkValidationError, r as CommerceSdkErrorBase, t as stringifyError } from "../error-
|
|
15
|
+
import { n as CommerceSdkValidationError, r as CommerceSdkErrorBase, t as stringifyError } from "../error-DTWSjf_4.mjs";
|
|
16
16
|
|
|
17
17
|
export { CommerceSdkErrorBase, CommerceSdkValidationError, stringifyError };
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { getDotPath } from "valibot";
|
|
16
15
|
import util from "util";
|
|
17
16
|
import { cyanBright, dim, whiteBright, yellowBright } from "ansis";
|
|
17
|
+
import { getDotPath } from "valibot";
|
|
18
18
|
|
|
19
19
|
// source/error/base-error.ts
|
|
20
20
|
/**
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* This module exports core HTTP header utilities for the AIO Commerce SDK.
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
|
-
import { r as RuntimeActionParams } from "../index-_sNhjzIe.mjs";
|
|
21
20
|
import { CamelCase } from "type-fest";
|
|
21
|
+
import { r as RuntimeActionParams } from "../index-_sNhjzIe.mjs";
|
|
22
22
|
/** The type of an HTTP header value. */
|
|
23
23
|
type HttpHeaderValue = string | string[] | undefined;
|
|
24
24
|
/** The type of an HTTP headers record. */
|
|
@@ -38,7 +38,9 @@ type GetHeaderReturn<T extends GetHeaderOptions | undefined> = T extends {
|
|
|
38
38
|
splitCommaSeparated: true;
|
|
39
39
|
} ? HttpHeaderValue : Exclude<HttpHeaderValue, string[]>;
|
|
40
40
|
/** The type of an HTTP header accessor object. */
|
|
41
|
-
type HttpHeaderAccessorMap<T extends string[], O extends GetHeaderOptions | undefined = undefined> = { [K in T[number] as CamelCase<K
|
|
41
|
+
type HttpHeaderAccessorMap<T extends string[], O extends GetHeaderOptions | undefined = undefined> = { [K in T[number] as CamelCase<K, {
|
|
42
|
+
preserveLeadingUnderscores: false;
|
|
43
|
+
}>]: Exclude<GetHeaderReturn<O>, undefined>; };
|
|
42
44
|
/**
|
|
43
45
|
* Creates a type-safe header accessor object with validated required headers.
|
|
44
46
|
* Header names are normalized to camelCase for consistent access.
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { n as CommerceSdkValidationError } from "../error-DHfBWC_D.mjs";
|
|
16
|
-
import { literal, nonEmpty, object, pipe, rawCheck, rawTransform, record, safeParse, string, trim, undefined as undefined$1, union } from "valibot";
|
|
17
15
|
import * as camelcaseModule from "camelcase";
|
|
16
|
+
import { literal, nonEmpty, object, pipe, rawCheck, rawTransform, record, safeParse, string, trim, undefined as undefined$1, union } from "valibot";
|
|
17
|
+
import { n as CommerceSdkValidationError } from "../error-DTWSjf_4.mjs";
|
|
18
18
|
|
|
19
19
|
// source/headers/camelcase.ts
|
|
20
20
|
const camelcase = camelcaseModule.default.default ?? camelcaseModule.default;
|
|
@@ -226,14 +226,12 @@ const LEADING_UNDERSCORES = /^_+/u;
|
|
|
226
226
|
/**
|
|
227
227
|
* Converts a header name to a camelCase key aligned with `type-fest`'s `CamelCase` type.
|
|
228
228
|
*
|
|
229
|
-
*
|
|
230
|
-
* `
|
|
231
|
-
* (e.g. `_foo_bar` → `fooBar`). Without stripping them first, runtime keys would diverge
|
|
232
|
-
* from the inferred TypeScript type.
|
|
229
|
+
* Leading underscores are dropped (e.g. `_foo_bar` → `fooBar`), matching
|
|
230
|
+
* `HttpHeaderAccessorMap`, which sets `preserveLeadingUnderscores: false`.
|
|
233
231
|
*
|
|
234
|
-
* @remarks
|
|
235
|
-
*
|
|
236
|
-
*
|
|
232
|
+
* @remarks Preserving leading underscores (a bare `camelcase(header)` call, which is the
|
|
233
|
+
* default for both `camelcase` v9+ and `type-fest` v6+) is a breaking change and must land
|
|
234
|
+
* in a major release, updating this function and `HttpHeaderAccessorMap` together.
|
|
237
235
|
*/
|
|
238
236
|
function toHeaderCamelKey(header) {
|
|
239
237
|
return camelcase(header.replace(LEADING_UNDERSCORES, ""));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aio-commerce-lib-core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1-beta-20261202103723",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Core utilities for Adobe Commerce SDK libraries",
|
|
6
6
|
"keywords": [
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"ansis": "^4.1.0",
|
|
53
53
|
"camelcase": "^10.0.0",
|
|
54
|
-
"type-fest": "^
|
|
54
|
+
"type-fest": "^6.0.0",
|
|
55
55
|
"valibot": "^1.1.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -74,11 +74,10 @@
|
|
|
74
74
|
"assist:apply": "biome check --write --formatter-enabled=false --linter-enabled=false --assist-enabled=true --no-errors-on-unmatched",
|
|
75
75
|
"build": "tsdown",
|
|
76
76
|
"check:ci": "biome ci --formatter-enabled=true --linter-enabled=true --assist-enabled=true --no-errors-on-unmatched",
|
|
77
|
-
"code:fix": "pnpm run lint:fix && pnpm run assist:apply && pnpm run format
|
|
78
|
-
"docs": "typedoc &&
|
|
77
|
+
"code:fix": "pnpm run lint:fix && pnpm run assist:apply && pnpm run format",
|
|
78
|
+
"docs": "typedoc && biome format --write --no-errors-on-unmatched docs",
|
|
79
79
|
"format": "biome format --write --no-errors-on-unmatched",
|
|
80
80
|
"format:check": "biome format --no-errors-on-unmatched",
|
|
81
|
-
"format:markdown": "prettier --no-error-on-unmatched-pattern --write '**/*.md' \"!**/{CODE_OF_CONDUCT.md,COPYRIGHT,LICENSE,SECURITY.md,CONTRIBUTING.md}\"",
|
|
82
81
|
"lint": "biome lint --no-errors-on-unmatched",
|
|
83
82
|
"lint:fix": "biome lint --write --no-errors-on-unmatched",
|
|
84
83
|
"pack": "pnpm pack",
|