@middy/util 4.2.4 → 4.2.6
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/index.d.ts +33 -9
- package/package.json +7 -3
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import middy from '@middy/core'
|
|
2
2
|
|
|
3
3
|
interface Options<Client, ClientOptions> {
|
|
4
|
-
AwsClient?: new(...args: any[]) => Client
|
|
4
|
+
AwsClient?: new (...args: any[]) => Client
|
|
5
5
|
awsClientOptions?: Partial<ClientOptions>
|
|
6
6
|
awsClientAssumeRole?: string
|
|
7
7
|
awsClientCapture?: (service: Client) => Client
|
|
@@ -20,26 +20,50 @@ type HttpError = Error & {
|
|
|
20
20
|
[key: number]: any
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
declare function createPrefetchClient<Client, ClientOptions> (
|
|
23
|
+
declare function createPrefetchClient<Client, ClientOptions> (
|
|
24
|
+
options: Options<Client, ClientOptions>
|
|
25
|
+
): Client
|
|
24
26
|
|
|
25
|
-
declare function createClient<Client, ClientOptions> (
|
|
27
|
+
declare function createClient<Client, ClientOptions> (
|
|
28
|
+
options: Options<Client, ClientOptions>,
|
|
29
|
+
request: middy.Request
|
|
30
|
+
): Promise<Client>
|
|
26
31
|
|
|
27
|
-
declare function canPrefetch<Client, ClientOptions> (
|
|
32
|
+
declare function canPrefetch<Client, ClientOptions> (
|
|
33
|
+
options: Options<Client, ClientOptions>
|
|
34
|
+
): boolean
|
|
28
35
|
|
|
29
|
-
declare function getInternal (
|
|
36
|
+
declare function getInternal (
|
|
37
|
+
variables: any,
|
|
38
|
+
request: middy.Request
|
|
39
|
+
): Promise<any>
|
|
30
40
|
|
|
31
41
|
declare function sanitizeKey (key: string): string
|
|
32
42
|
|
|
33
|
-
declare function processCache<Client, ClientOptions> (
|
|
43
|
+
declare function processCache<Client, ClientOptions> (
|
|
44
|
+
options: Options<Client, ClientOptions>,
|
|
45
|
+
fetch: (request: middy.Request, cachedValues: any) => any,
|
|
46
|
+
request?: middy.Request
|
|
47
|
+
): { value: any, expiry: number }
|
|
34
48
|
|
|
35
49
|
declare function getCache (keys: string): any
|
|
36
50
|
|
|
37
51
|
declare function clearCache (keys?: string | string[] | null): void
|
|
38
52
|
|
|
39
|
-
declare function jsonSafeParse (
|
|
53
|
+
declare function jsonSafeParse (
|
|
54
|
+
string: string,
|
|
55
|
+
reviver?: (key: string, value: any) => any
|
|
56
|
+
): any
|
|
40
57
|
|
|
41
|
-
declare function normalizeHttpResponse (
|
|
58
|
+
declare function normalizeHttpResponse (
|
|
59
|
+
request: any,
|
|
60
|
+
fallbackResponse?: any
|
|
61
|
+
): any
|
|
42
62
|
|
|
43
|
-
declare function createError (
|
|
63
|
+
declare function createError (
|
|
64
|
+
code: number,
|
|
65
|
+
message: string,
|
|
66
|
+
properties?: Record<string, any>
|
|
67
|
+
): HttpError
|
|
44
68
|
|
|
45
69
|
declare function modifyCache (cacheKey: string, value: any): void
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/util",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.6",
|
|
4
4
|
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (util package)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -61,11 +61,15 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@aws-sdk/client-ssm": "^3.0.0",
|
|
64
|
-
"@middy/core": "4.2.
|
|
64
|
+
"@middy/core": "4.2.6",
|
|
65
65
|
"@types/aws-lambda": "^8.10.76",
|
|
66
66
|
"@types/node": "^18.0.0",
|
|
67
67
|
"aws-xray-sdk": "^3.3.3"
|
|
68
68
|
},
|
|
69
69
|
"homepage": "https://middy.js.org",
|
|
70
|
-
"
|
|
70
|
+
"funding": {
|
|
71
|
+
"type": "github",
|
|
72
|
+
"url": "https://github.com/sponsors/willfarrell"
|
|
73
|
+
},
|
|
74
|
+
"gitHead": "8868ba216442cc42321a251712bc90b9147c0a44"
|
|
71
75
|
}
|