@adobe/spacecat-shared-http-utils 1.10.6 → 1.12.0
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 +14 -0
- package/package.json +1 -1
- package/src/index.d.ts +4 -2
- package/src/index.js +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@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)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* 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))
|
|
7
|
+
|
|
8
|
+
# [@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)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **http-utils:** add HTTP 202 Accepted response helper ([#722](https://github.com/adobe/spacecat-shared/issues/722)) ([934ef6c](https://github.com/adobe/spacecat-shared/commit/934ef6ce71914918bae5b06600193cc3408a46e0))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-http-utils-v1.10.6](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.10.5...@adobe/spacecat-shared-http-utils-v1.10.6) (2025-05-10)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -11,9 +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
|
+
|
|
18
|
+
export declare function accepted(body: object, headers?: object): Response;
|
|
17
19
|
|
|
18
20
|
export declare function noContent(headers?: object): Response;
|
|
19
21
|
|
package/src/index.js
CHANGED
|
@@ -50,12 +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
|
+
}
|
|
60
|
+
|
|
61
|
+
export function accepted(body, headers = {}) {
|
|
62
|
+
return createResponse(body, 202, headers);
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
export function noContent(headers = {}) {
|