@adobe/spacecat-shared-http-utils 1.2.1 → 1.3.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 +7 -0
- package/package.json +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-http-utils-v1.3.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.2.1...@adobe/spacecat-shared-http-utils-v1.3.0) (2024-05-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* introduce google client ([#219](https://github.com/adobe/spacecat-shared/issues/219)) ([71eeb64](https://github.com/adobe/spacecat-shared/commit/71eeb64a7efe2037b5d40f0c62668b9eaf41aeb8))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-http-utils-v1.2.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.2.0...@adobe/spacecat-shared-http-utils-v1.2.1) (2024-05-03)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -22,3 +22,5 @@ export declare function badRequest(message?: string, headers?: object): Response
|
|
|
22
22
|
export declare function notFound(message?: string, headers?: object): Response;
|
|
23
23
|
|
|
24
24
|
export declare function internalServerError(message?: string, headers?: object): Response;
|
|
25
|
+
|
|
26
|
+
export declare function found(location: string): Response;
|
package/src/index.js
CHANGED
|
@@ -40,6 +40,12 @@ export function noContent(headers = {}) {
|
|
|
40
40
|
return createResponse('', 204, headers);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
export function found(location, body = '') {
|
|
44
|
+
return createResponse(body, 302, {
|
|
45
|
+
Location: location,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
export function badRequest(message = 'bad request', headers = {}) {
|
|
44
50
|
return createResponse({ message }, 400, {
|
|
45
51
|
'x-error': message,
|