@adobe/aio-commerce-lib-core 1.0.0 → 1.1.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @adobe/aio-commerce-lib-core
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#470](https://github.com/adobe/aio-commerce-sdk/pull/470) [`ec2d426`](https://github.com/adobe/aio-commerce-sdk/commit/ec2d4262166bde68a434025667f38609313ad712) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix CJS interop for ESM-only dependencies (`camelcase`, `ky`) on Node.js 22+
8
+
9
+ ## 1.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#345](https://github.com/adobe/aio-commerce-sdk/pull/345) [`38adb09`](https://github.com/adobe/aio-commerce-sdk/commit/38adb09e1e2bd1b8fa764ecc2e0d21ecc0071ca7) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Drop Node 20 support (EOL April 2026).
14
+
3
15
  ## 1.0.0
4
16
 
5
17
  ### Major Changes
@@ -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_validation_error = require('../validation-error-DuipISU5.cjs');
16
+ const require_error = require('../error-sJoC2Xru.cjs');
3
17
 
4
- exports.CommerceSdkErrorBase = require_validation_error.CommerceSdkErrorBase;
5
- exports.CommerceSdkValidationError = require_validation_error.CommerceSdkValidationError;
18
+ exports.CommerceSdkErrorBase = require_error.CommerceSdkErrorBase;
19
+ exports.CommerceSdkValidationError = require_error.CommerceSdkValidationError;
@@ -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 { GenericIssue } from "valibot";
2
16
 
3
17
  //#region source/error/base-error.d.ts
@@ -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;
@@ -26,7 +40,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
40
 
27
41
  //#endregion
28
42
  let util = require("util");
29
- util = __toESM(util);
43
+ util = __toESM(util, 1);
30
44
  let ansis = require("ansis");
31
45
  let valibot = require("valibot");
32
46
 
@@ -1,9 +1,27 @@
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_validation_error = require('../validation-error-DuipISU5.cjs');
16
+ const require_error = require('../error-sJoC2Xru.cjs');
3
17
  let valibot = require("valibot");
4
18
  let camelcase = require("camelcase");
5
- camelcase = require_validation_error.__toESM(camelcase);
19
+ camelcase = require_error.__toESM(camelcase, 1);
20
+
21
+ //#region source/headers/camelcase.ts
22
+ const camelcase$1 = camelcase.default.default ?? camelcase.default;
6
23
 
24
+ //#endregion
7
25
  //#region source/headers/helpers.ts
8
26
  /**
9
27
  * Extracts a header value from an object with case-insensitive lookup.
@@ -63,7 +81,7 @@ function getHeader(headers, name, options) {
63
81
  */
64
82
  function getHeadersFromParams(params) {
65
83
  const parsed = (0, valibot.safeParse)((0, valibot.object)({ __ow_headers: (0, valibot.record)((0, valibot.string)(), (0, valibot.union)([(0, valibot.string)(), (0, valibot.undefined)()])) }), params);
66
- if (!parsed.success) throw new require_validation_error.CommerceSdkValidationError("Missing __ow_headers in action params", { issues: parsed.issues });
84
+ if (!parsed.success) throw new require_error.CommerceSdkValidationError("Missing __ow_headers in action params", { issues: parsed.issues });
67
85
  return parsed.output.__ow_headers;
68
86
  }
69
87
 
@@ -170,7 +188,7 @@ function assertRequiredHeadersSchema(headers, requiredHeaders) {
170
188
  if (value !== void 0 && value !== null) normalized[key.toLowerCase()] = value;
171
189
  }
172
190
  const parsed = (0, valibot.safeParse)(buildHeadersSchema(requiredHeaders), normalized);
173
- if (!parsed.success) throw new require_validation_error.CommerceSdkValidationError("The headers object does not match the required headers (case-insensitive)", { issues: parsed.issues });
191
+ if (!parsed.success) throw new require_error.CommerceSdkValidationError("The headers object does not match the required headers (case-insensitive)", { issues: parsed.issues });
174
192
  }
175
193
  /**
176
194
  * Validates that required headers are present and non-empty in the headers object.
@@ -206,6 +224,22 @@ function assertRequiredHeaders(headers, requiredHeaders) {
206
224
 
207
225
  //#endregion
208
226
  //#region source/headers/accessor.ts
227
+ const LEADING_UNDERSCORES = /^_+/;
228
+ /**
229
+ * Converts a header name to a camelCase key aligned with `type-fest`'s `CamelCase` type.
230
+ *
231
+ * `camelcase` v9+ preserves leading underscores (e.g. `_foo_bar` → `_fooBar`), but
232
+ * `type-fest`'s `CamelCase` — used by `HttpHeaderAccessorMap` — drops them
233
+ * (e.g. `_foo_bar` → `fooBar`). Without stripping them first, runtime keys would diverge
234
+ * from the inferred TypeScript type.
235
+ *
236
+ * @remarks This function must be removed and replaced with a bare `camelcase(header)` call
237
+ * once the two helpers agree on leading-underscore handling. That cleanup is a breaking
238
+ * change and must land in a major release.
239
+ */
240
+ function toHeaderCamelKey(header) {
241
+ return camelcase$1(header.replace(LEADING_UNDERSCORES, ""));
242
+ }
209
243
  /**
210
244
  * Creates a type-safe header accessor object with validated required headers.
211
245
  * Header names are normalized to camelCase for consistent access.
@@ -240,7 +274,7 @@ function createHeaderAccessor(headers, requiredHeaders, options) {
240
274
  assertRequiredHeaders(headers, requiredHeaders);
241
275
  const accessor = {};
242
276
  for (const header of requiredHeaders) {
243
- const camelKey = (0, camelcase.default)(header);
277
+ const camelKey = toHeaderCamelKey(header);
244
278
  accessor[camelKey] = getHeader(headers, header, options);
245
279
  }
246
280
  return accessor;
@@ -278,7 +312,7 @@ function parseKeyValueParameters(parametersString) {
278
312
  let match = paramPattern.exec(parametersString);
279
313
  while (match !== null) {
280
314
  const [, key, quotedValue, unquotedValue] = match;
281
- params[key] = quotedValue !== void 0 ? quotedValue : unquotedValue;
315
+ params[key] = quotedValue === void 0 ? unquotedValue : quotedValue;
282
316
  match = paramPattern.exec(parametersString);
283
317
  }
284
318
  return params;
@@ -329,7 +363,7 @@ const authorizationSchema = (0, valibot.pipe)((0, valibot.string)("Expected a st
329
363
  */
330
364
  function parseAuthorization(authorization) {
331
365
  const parsed = (0, valibot.safeParse)(authorizationSchema, authorization);
332
- if (!parsed.success) throw new require_validation_error.CommerceSdkValidationError("Invalid Authorization header format", { issues: parsed.issues });
366
+ if (!parsed.success) throw new require_error.CommerceSdkValidationError("Invalid Authorization header format", { issues: parsed.issues });
333
367
  const { scheme, parameters } = parsed.output;
334
368
  if (scheme === "Bearer") return {
335
369
  scheme: "Bearer",
@@ -374,7 +408,7 @@ const bearerSchema = (0, valibot.object)({ scheme: (0, valibot.literal)("Bearer"
374
408
  function parseBearerToken(authorization) {
375
409
  const auth = parseAuthorization(authorization);
376
410
  const parsed = (0, valibot.safeParse)(bearerSchema, auth);
377
- if (!parsed.success) throw new require_validation_error.CommerceSdkValidationError("Authorization header must be a Bearer token", { issues: parsed.issues });
411
+ if (!parsed.success) throw new require_error.CommerceSdkValidationError("Authorization header must be a Bearer token", { issues: parsed.issues });
378
412
  return auth;
379
413
  }
380
414
  const basicSchema = (0, valibot.object)({ scheme: (0, valibot.literal)("Basic") });
@@ -393,7 +427,7 @@ const basicSchema = (0, valibot.object)({ scheme: (0, valibot.literal)("Basic")
393
427
  function parseBasicToken(authorization) {
394
428
  const auth = parseAuthorization(authorization);
395
429
  const parsed = (0, valibot.safeParse)(basicSchema, auth);
396
- if (!parsed.success) throw new require_validation_error.CommerceSdkValidationError("Authorization header must be Basic authentication", { issues: parsed.issues });
430
+ if (!parsed.success) throw new require_error.CommerceSdkValidationError("Authorization header must be Basic authentication", { issues: parsed.issues });
397
431
  return auth;
398
432
  }
399
433
  const oauthSchema = (0, valibot.object)({ scheme: (0, valibot.literal)("OAuth") });
@@ -413,7 +447,7 @@ const oauthSchema = (0, valibot.object)({ scheme: (0, valibot.literal)("OAuth")
413
447
  function parseOAuthToken(authorization) {
414
448
  const auth = parseAuthorization(authorization);
415
449
  const parsed = (0, valibot.safeParse)(oauthSchema, auth);
416
- if (!parsed.success) throw new require_validation_error.CommerceSdkValidationError("Authorization header must be OAuth", { issues: parsed.issues });
450
+ if (!parsed.success) throw new require_error.CommerceSdkValidationError("Authorization header must be OAuth", { issues: parsed.issues });
417
451
  return auth;
418
452
  }
419
453
 
@@ -1,4 +1,18 @@
1
- import { r as RuntimeActionParams } from "../types-CfxNboCU.cjs";
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
+
15
+ import { r as RuntimeActionParams } from "../index-CkxLqyh-.cjs";
2
16
  import { CamelCase } from "type-fest";
3
17
 
4
18
  //#region source/headers/types.d.ts
@@ -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 source/params/helpers.d.ts
2
16
  /**
3
17
  * Checks if the given runtime action input value is non-empty.
@@ -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
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
16
 
3
17
  //#region source/params/helpers.ts
@@ -1,2 +1,16 @@
1
- import { a as nonEmpty, i as allNonEmpty, n as HttpMethodLowercase, r as RuntimeActionParams, t as HttpMethod } from "../types-CfxNboCU.cjs";
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
+
15
+ import { a as nonEmpty, i as allNonEmpty, n as HttpMethodLowercase, r as RuntimeActionParams, t as HttpMethod } from "../index-CkxLqyh-.cjs";
2
16
  export { HttpMethod, HttpMethodLowercase, RuntimeActionParams, allNonEmpty, nonEmpty };
@@ -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
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
16
 
3
17
  //#region source/responses/helpers.ts
@@ -109,62 +123,62 @@ function curryBuildErrorResponse(code) {
109
123
  * Creates a success response with the HTTP status code 200.
110
124
  * See {@link buildSuccessResponse} for details on the response payload.
111
125
  */
112
- const ok = curryBuildSuccessResponse(HTTP_OK);
126
+ const ok = curryBuildSuccessResponse(200);
113
127
  /**
114
128
  * Creates a success response with the HTTP status code 201.
115
129
  * See {@link buildSuccessResponse} for details on the response payload.
116
130
  */
117
- const created = curryBuildSuccessResponse(HTTP_CREATED);
131
+ const created = curryBuildSuccessResponse(201);
118
132
  /**
119
133
  * Creates a success response with the HTTP status code 202.
120
134
  * See {@link buildSuccessResponse} for details on the response payload.
121
135
  */
122
- const accepted = curryBuildSuccessResponse(HTTP_ACCEPTED);
136
+ const accepted = curryBuildSuccessResponse(202);
123
137
  /**
124
138
  * Creates a success response with the HTTP status code 203.
125
139
  * See {@link buildSuccessResponse} for details on the response payload.
126
140
  */
127
- const nonAuthoritativeInformation = curryBuildSuccessResponse(HTTP_NON_AUTHORITATIVE_INFORMATION);
141
+ const nonAuthoritativeInformation = curryBuildSuccessResponse(203);
128
142
  /**
129
143
  * Creates a success response with the HTTP status code 204 (No Content).
130
144
  * This response has no body.
131
145
  */
132
- const noContent = () => buildSuccessResponse(HTTP_NO_CONTENT);
146
+ const noContent = () => buildSuccessResponse(204);
133
147
  /**
134
148
  * Creates an error response with the HTTP status code 400.
135
149
  * See {@link buildErrorResponse} for details on the response payload.
136
150
  */
137
- const badRequest = curryBuildErrorResponse(HTTP_BAD_REQUEST);
151
+ const badRequest = curryBuildErrorResponse(400);
138
152
  /**
139
153
  * Creates an error response with the HTTP status code 401.
140
154
  * See {@link buildErrorResponse} for details on the response payload.
141
155
  */
142
- const unauthorized = curryBuildErrorResponse(HTTP_UNAUTHORIZED);
156
+ const unauthorized = curryBuildErrorResponse(401);
143
157
  /**
144
158
  * Creates an error response with the HTTP status code 403.
145
159
  * See {@link buildErrorResponse} for details on the response payload.
146
160
  */
147
- const forbidden = curryBuildErrorResponse(HTTP_FORBIDDEN);
161
+ const forbidden = curryBuildErrorResponse(403);
148
162
  /**
149
163
  * Creates an error response with the HTTP status code 404.
150
164
  * See {@link buildErrorResponse} for details on the response payload.
151
165
  */
152
- const notFound = curryBuildErrorResponse(HTTP_NOT_FOUND);
166
+ const notFound = curryBuildErrorResponse(404);
153
167
  /**
154
168
  * Creates an error response with the HTTP status code 405.
155
169
  * See {@link buildErrorResponse} for details on the response payload.
156
170
  */
157
- const methodNotAllowed = curryBuildErrorResponse(HTTP_METHOD_NOT_ALLOWED);
171
+ const methodNotAllowed = curryBuildErrorResponse(405);
158
172
  /**
159
173
  * Creates an error response with the HTTP status code 409.
160
174
  * See {@link buildErrorResponse} for details on the response payload.
161
175
  */
162
- const conflict = curryBuildErrorResponse(HTTP_CONFLICT);
176
+ const conflict = curryBuildErrorResponse(409);
163
177
  /**
164
178
  * Creates an error response with the HTTP status code 500.
165
179
  * See {@link buildErrorResponse} for details on the response payload.
166
180
  */
167
- const internalServerError = curryBuildErrorResponse(HTTP_INTERNAL_SERVER_ERROR);
181
+ const internalServerError = curryBuildErrorResponse(500);
168
182
 
169
183
  //#endregion
170
184
  exports.HTTP_ACCEPTED = HTTP_ACCEPTED;
@@ -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 source/responses/helpers.d.ts
2
16
  type HeadersRecord = Record<string, string>;
3
17
  type BodyRecord = Record<string, unknown>;
@@ -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 { GenericIssue } from "valibot";
2
16
 
3
17
  //#region source/error/base-error.d.ts
@@ -1,3 +1,17 @@
1
- import { n as CommerceSdkErrorBase, t as CommerceSdkValidationError } from "../validation-error-DT4-Oa0Z.mjs";
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
+
15
+ import { n as CommerceSdkErrorBase, t as CommerceSdkValidationError } from "../error-WnQqveay.mjs";
2
16
 
3
17
  export { CommerceSdkErrorBase, CommerceSdkValidationError };
@@ -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 util from "util";
2
16
  import { cyanBright, dim, whiteBright, yellowBright } from "ansis";
3
17
  import { getDotPath } from "valibot";
@@ -1,4 +1,18 @@
1
- import { r as RuntimeActionParams } from "../types-CMBSX5l-.mjs";
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
+
15
+ import { r as RuntimeActionParams } from "../index-CkxLqyh-.mjs";
2
16
  import { CamelCase } from "type-fest";
3
17
 
4
18
  //#region source/headers/types.d.ts
@@ -1,7 +1,25 @@
1
- import { t as CommerceSdkValidationError } from "../validation-error-DT4-Oa0Z.mjs";
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
+
15
+ import { t as CommerceSdkValidationError } from "../error-WnQqveay.mjs";
2
16
  import { literal, nonEmpty, object, pipe, rawCheck, rawTransform, record, safeParse, string, trim, undefined as undefined$1, union } from "valibot";
3
- import camelcase from "camelcase";
17
+ import * as camelcaseModule from "camelcase";
18
+
19
+ //#region source/headers/camelcase.ts
20
+ const camelcase = camelcaseModule.default.default ?? camelcaseModule.default;
4
21
 
22
+ //#endregion
5
23
  //#region source/headers/helpers.ts
6
24
  /**
7
25
  * Extracts a header value from an object with case-insensitive lookup.
@@ -204,6 +222,22 @@ function assertRequiredHeaders(headers, requiredHeaders) {
204
222
 
205
223
  //#endregion
206
224
  //#region source/headers/accessor.ts
225
+ const LEADING_UNDERSCORES = /^_+/;
226
+ /**
227
+ * Converts a header name to a camelCase key aligned with `type-fest`'s `CamelCase` type.
228
+ *
229
+ * `camelcase` v9+ preserves leading underscores (e.g. `_foo_bar` → `_fooBar`), but
230
+ * `type-fest`'s `CamelCase` — used by `HttpHeaderAccessorMap` — drops them
231
+ * (e.g. `_foo_bar` → `fooBar`). Without stripping them first, runtime keys would diverge
232
+ * from the inferred TypeScript type.
233
+ *
234
+ * @remarks This function must be removed and replaced with a bare `camelcase(header)` call
235
+ * once the two helpers agree on leading-underscore handling. That cleanup is a breaking
236
+ * change and must land in a major release.
237
+ */
238
+ function toHeaderCamelKey(header) {
239
+ return camelcase(header.replace(LEADING_UNDERSCORES, ""));
240
+ }
207
241
  /**
208
242
  * Creates a type-safe header accessor object with validated required headers.
209
243
  * Header names are normalized to camelCase for consistent access.
@@ -238,7 +272,7 @@ function createHeaderAccessor(headers, requiredHeaders, options) {
238
272
  assertRequiredHeaders(headers, requiredHeaders);
239
273
  const accessor = {};
240
274
  for (const header of requiredHeaders) {
241
- const camelKey = camelcase(header);
275
+ const camelKey = toHeaderCamelKey(header);
242
276
  accessor[camelKey] = getHeader(headers, header, options);
243
277
  }
244
278
  return accessor;
@@ -276,7 +310,7 @@ function parseKeyValueParameters(parametersString) {
276
310
  let match = paramPattern.exec(parametersString);
277
311
  while (match !== null) {
278
312
  const [, key, quotedValue, unquotedValue] = match;
279
- params[key] = quotedValue !== void 0 ? quotedValue : unquotedValue;
313
+ params[key] = quotedValue === void 0 ? unquotedValue : quotedValue;
280
314
  match = paramPattern.exec(parametersString);
281
315
  }
282
316
  return params;
@@ -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 source/params/helpers.d.ts
2
16
  /**
3
17
  * Checks if the given runtime action input value is non-empty.
@@ -1,2 +1,16 @@
1
- import { a as nonEmpty, i as allNonEmpty, n as HttpMethodLowercase, r as RuntimeActionParams, t as HttpMethod } from "../types-CMBSX5l-.mjs";
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
+
15
+ import { a as nonEmpty, i as allNonEmpty, n as HttpMethodLowercase, r as RuntimeActionParams, t as HttpMethod } from "../index-CkxLqyh-.mjs";
2
16
  export { HttpMethod, HttpMethodLowercase, RuntimeActionParams, allNonEmpty, nonEmpty };
@@ -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 source/params/helpers.ts
2
16
  /**
3
17
  * Checks if the given runtime action input value is non-empty.
@@ -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 source/responses/helpers.d.ts
2
16
  type HeadersRecord = Record<string, string>;
3
17
  type BodyRecord = Record<string, unknown>;
@@ -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 source/responses/helpers.ts
2
16
  /**
3
17
  * Creates a standardized error response for runtime actions
@@ -107,62 +121,62 @@ function curryBuildErrorResponse(code) {
107
121
  * Creates a success response with the HTTP status code 200.
108
122
  * See {@link buildSuccessResponse} for details on the response payload.
109
123
  */
110
- const ok = curryBuildSuccessResponse(HTTP_OK);
124
+ const ok = curryBuildSuccessResponse(200);
111
125
  /**
112
126
  * Creates a success response with the HTTP status code 201.
113
127
  * See {@link buildSuccessResponse} for details on the response payload.
114
128
  */
115
- const created = curryBuildSuccessResponse(HTTP_CREATED);
129
+ const created = curryBuildSuccessResponse(201);
116
130
  /**
117
131
  * Creates a success response with the HTTP status code 202.
118
132
  * See {@link buildSuccessResponse} for details on the response payload.
119
133
  */
120
- const accepted = curryBuildSuccessResponse(HTTP_ACCEPTED);
134
+ const accepted = curryBuildSuccessResponse(202);
121
135
  /**
122
136
  * Creates a success response with the HTTP status code 203.
123
137
  * See {@link buildSuccessResponse} for details on the response payload.
124
138
  */
125
- const nonAuthoritativeInformation = curryBuildSuccessResponse(HTTP_NON_AUTHORITATIVE_INFORMATION);
139
+ const nonAuthoritativeInformation = curryBuildSuccessResponse(203);
126
140
  /**
127
141
  * Creates a success response with the HTTP status code 204 (No Content).
128
142
  * This response has no body.
129
143
  */
130
- const noContent = () => buildSuccessResponse(HTTP_NO_CONTENT);
144
+ const noContent = () => buildSuccessResponse(204);
131
145
  /**
132
146
  * Creates an error response with the HTTP status code 400.
133
147
  * See {@link buildErrorResponse} for details on the response payload.
134
148
  */
135
- const badRequest = curryBuildErrorResponse(HTTP_BAD_REQUEST);
149
+ const badRequest = curryBuildErrorResponse(400);
136
150
  /**
137
151
  * Creates an error response with the HTTP status code 401.
138
152
  * See {@link buildErrorResponse} for details on the response payload.
139
153
  */
140
- const unauthorized = curryBuildErrorResponse(HTTP_UNAUTHORIZED);
154
+ const unauthorized = curryBuildErrorResponse(401);
141
155
  /**
142
156
  * Creates an error response with the HTTP status code 403.
143
157
  * See {@link buildErrorResponse} for details on the response payload.
144
158
  */
145
- const forbidden = curryBuildErrorResponse(HTTP_FORBIDDEN);
159
+ const forbidden = curryBuildErrorResponse(403);
146
160
  /**
147
161
  * Creates an error response with the HTTP status code 404.
148
162
  * See {@link buildErrorResponse} for details on the response payload.
149
163
  */
150
- const notFound = curryBuildErrorResponse(HTTP_NOT_FOUND);
164
+ const notFound = curryBuildErrorResponse(404);
151
165
  /**
152
166
  * Creates an error response with the HTTP status code 405.
153
167
  * See {@link buildErrorResponse} for details on the response payload.
154
168
  */
155
- const methodNotAllowed = curryBuildErrorResponse(HTTP_METHOD_NOT_ALLOWED);
169
+ const methodNotAllowed = curryBuildErrorResponse(405);
156
170
  /**
157
171
  * Creates an error response with the HTTP status code 409.
158
172
  * See {@link buildErrorResponse} for details on the response payload.
159
173
  */
160
- const conflict = curryBuildErrorResponse(HTTP_CONFLICT);
174
+ const conflict = curryBuildErrorResponse(409);
161
175
  /**
162
176
  * Creates an error response with the HTTP status code 500.
163
177
  * See {@link buildErrorResponse} for details on the response payload.
164
178
  */
165
- const internalServerError = curryBuildErrorResponse(HTTP_INTERNAL_SERVER_ERROR);
179
+ const internalServerError = curryBuildErrorResponse(500);
166
180
 
167
181
  //#endregion
168
182
  export { HTTP_ACCEPTED, HTTP_BAD_REQUEST, HTTP_CONFLICT, HTTP_CREATED, HTTP_FORBIDDEN, HTTP_INTERNAL_SERVER_ERROR, HTTP_METHOD_NOT_ALLOWED, HTTP_NON_AUTHORITATIVE_INFORMATION, HTTP_NOT_FOUND, HTTP_NO_CONTENT, HTTP_OK, HTTP_UNAUTHORIZED, accepted, badRequest, buildErrorResponse, buildSuccessResponse, conflict, created, forbidden, internalServerError, methodNotAllowed, noContent, nonAuthoritativeInformation, notFound, ok, unauthorized };
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "name": "@adobe/aio-commerce-lib-core",
3
3
  "type": "module",
4
4
  "author": "Adobe Inc.",
5
- "version": "1.0.0",
5
+ "version": "1.1.1",
6
6
  "private": false,
7
7
  "engines": {
8
- "node": ">=20 <=24"
8
+ "node": ">=22 <=24"
9
9
  },
10
10
  "license": "Apache-2.0",
11
11
  "description": "Core utilities for Adobe Commerce SDK libraries",
@@ -27,6 +27,10 @@
27
27
  "url": "git+https://github.com/adobe/aio-commerce-sdk.git",
28
28
  "directory": "packages/aio-commerce-lib-core"
29
29
  },
30
+ "publishConfig": {
31
+ "registry": "https://registry.npmjs.org",
32
+ "access": "public"
33
+ },
30
34
  "exports": {
31
35
  "./*": {
32
36
  "import": {
@@ -52,12 +56,12 @@
52
56
  ],
53
57
  "dependencies": {
54
58
  "ansis": "^4.1.0",
55
- "camelcase": "^8.0.0",
59
+ "camelcase": "^9.0.0",
56
60
  "type-fest": "^5.0.0",
57
61
  "valibot": "^1.1.0"
58
62
  },
59
63
  "devDependencies": {
60
- "typescript": "^5.9.2",
64
+ "typescript": "^6.0.0",
61
65
  "@aio-commerce-sdk/config-tsdown": "1.0.1",
62
66
  "@aio-commerce-sdk/config-typedoc": "1.0.0",
63
67
  "@aio-commerce-sdk/config-typescript": "1.0.0",
@@ -72,6 +76,7 @@
72
76
  "assist": "biome check --formatter-enabled=false --linter-enabled=false --assist-enabled=true --no-errors-on-unmatched",
73
77
  "assist:apply": "biome check --write --formatter-enabled=false --linter-enabled=false --assist-enabled=true --no-errors-on-unmatched",
74
78
  "check:ci": "biome ci --formatter-enabled=true --linter-enabled=true --assist-enabled=true --no-errors-on-unmatched",
79
+ "code:fix": "pnpm run lint:fix && pnpm run assist:apply && pnpm run format && pnpm run format:markdown",
75
80
  "format": "biome format --write --no-errors-on-unmatched",
76
81
  "format:markdown": "prettier --no-error-on-unmatched-pattern --write '**/*.md' \"!**/{CODE_OF_CONDUCT.md,COPYRIGHT,LICENSE,SECURITY.md,CONTRIBUTING.md}\"",
77
82
  "format:check": "biome format --no-errors-on-unmatched",