@adobe/spacecat-shared-http-utils 1.11.0 → 1.12.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,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-http-utils-v1.12.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.12.0...@adobe/spacecat-shared-http-utils-v1.12.1) (2025-05-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @adobe/fetch to v4.2.2 ([#747](https://github.com/adobe/spacecat-shared/issues/747)) ([64e350a](https://github.com/adobe/spacecat-shared/commit/64e350ad62b7b6d3ad9aa47c66f51ba16508fc6c))
7
+
8
+ # [@adobe/spacecat-shared-http-utils-v1.12.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.11.0...@adobe/spacecat-shared-http-utils-v1.12.0) (2025-05-19)
9
+
10
+
11
+ ### Features
12
+
13
+ * http-utils 2xx methods support optional headers ([#746](https://github.com/adobe/spacecat-shared/issues/746)) ([4319d47](https://github.com/adobe/spacecat-shared/commit/4319d479341aa06c5251495389580f3663d1ec57))
14
+
1
15
  # [@adobe/spacecat-shared-http-utils-v1.11.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.10.6...@adobe/spacecat-shared-http-utils-v1.11.0) (2025-05-12)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-http-utils",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "description": "Shared modules of the Spacecat Services - HTTP Utils",
5
5
  "type": "module",
6
6
  "engines": {
@@ -33,7 +33,7 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@adobe/fetch": "4.2.1",
36
+ "@adobe/fetch": "4.2.2",
37
37
  "@adobe/spacecat-shared-utils": "1.26.4",
38
38
  "@adobe/spacecat-shared-data-access": "2.0.2",
39
39
  "jose": "6.0.11"
package/src/index.d.ts CHANGED
@@ -11,11 +11,11 @@
11
11
  */
12
12
  import { Response } from '@adobe/fetch';
13
13
 
14
- export declare function ok(body?: string): Response;
14
+ export declare function ok(body?: string, headers?: object): Response;
15
15
 
16
- export declare function created(body: object): Response;
16
+ export declare function created(body: object, headers?: object): Response;
17
17
 
18
- export declare function accepted(body: object): Response;
18
+ export declare function accepted(body: object, headers?: object): Response;
19
19
 
20
20
  export declare function noContent(headers?: object): Response;
21
21
 
package/src/index.js CHANGED
@@ -50,16 +50,16 @@ export function createResponse(body, status = 200, headers = {}) {
50
50
  });
51
51
  }
52
52
 
53
- export function ok(body = '') {
54
- return createResponse(body, 200);
53
+ export function ok(body = '', headers = {}) {
54
+ return createResponse(body, 200, headers);
55
55
  }
56
56
 
57
- export function created(body) {
58
- return createResponse(body, 201);
57
+ export function created(body, headers = {}) {
58
+ return createResponse(body, 201, headers);
59
59
  }
60
60
 
61
- export function accepted(body) {
62
- return createResponse(body, 202);
61
+ export function accepted(body, headers = {}) {
62
+ return createResponse(body, 202, headers);
63
63
  }
64
64
 
65
65
  export function noContent(headers = {}) {