@faasjs/http 0.0.4-beta.10 → 0.0.4-beta.11
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/README.md +25 -25
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -64,15 +64,15 @@ ___
|
|
|
64
64
|
|
|
65
65
|
### HttpConfig
|
|
66
66
|
|
|
67
|
-
Ƭ **HttpConfig
|
|
67
|
+
Ƭ **HttpConfig**\<`TParams`, `TCookie`, `TSession`\>: `Object`
|
|
68
68
|
|
|
69
69
|
#### Type parameters
|
|
70
70
|
|
|
71
71
|
| Name | Type |
|
|
72
72
|
| :------ | :------ |
|
|
73
|
-
| `TParams` | extends `Record
|
|
74
|
-
| `TCookie` | extends `Record
|
|
75
|
-
| `TSession` | extends `Record
|
|
73
|
+
| `TParams` | extends `Record`\<`string`, `any`\> = `any` |
|
|
74
|
+
| `TCookie` | extends `Record`\<`string`, `string`\> = `any` |
|
|
75
|
+
| `TSession` | extends `Record`\<`string`, `string`\> = `any` |
|
|
76
76
|
|
|
77
77
|
#### Index signature
|
|
78
78
|
|
|
@@ -82,7 +82,7 @@ ___
|
|
|
82
82
|
|
|
83
83
|
| Name | Type |
|
|
84
84
|
| :------ | :------ |
|
|
85
|
-
| `config?` | { `[key: string]`: `any`; `cookie?`: [`CookieOptions`](#cookieoptions) ; `functionName?`: `string` ; `ignorePathPrefix?`: `string` ; `method?`: ``"BEGIN"`` \| ``"GET"`` \| ``"POST"`` \| ``"DELETE"`` \| ``"HEAD"`` \| ``"PUT"`` \| ``"OPTIONS"`` \| ``"TRACE"`` \| ``"PATCH"`` \| ``"ANY"`` ; `path?`: `string` ; `timeout?`: `number` } |
|
|
85
|
+
| `config?` | \{ `[key: string]`: `any`; `cookie?`: [`CookieOptions`](#cookieoptions) ; `functionName?`: `string` ; `ignorePathPrefix?`: `string` ; `method?`: ``"BEGIN"`` \| ``"GET"`` \| ``"POST"`` \| ``"DELETE"`` \| ``"HEAD"`` \| ``"PUT"`` \| ``"OPTIONS"`` \| ``"TRACE"`` \| ``"PATCH"`` \| ``"ANY"`` ; `path?`: `string` ; `timeout?`: `number` } |
|
|
86
86
|
| `config.cookie?` | [`CookieOptions`](#cookieoptions) |
|
|
87
87
|
| `config.functionName?` | `string` |
|
|
88
88
|
| `config.ignorePathPrefix?` | `string` |
|
|
@@ -90,7 +90,7 @@ ___
|
|
|
90
90
|
| `config.path?` | `string` |
|
|
91
91
|
| `config.timeout?` | `number` |
|
|
92
92
|
| `name?` | `string` |
|
|
93
|
-
| `validator?` | [`ValidatorConfig`](#validatorconfig)
|
|
93
|
+
| `validator?` | [`ValidatorConfig`](#validatorconfig)\<`TParams`, `TCookie`, `TSession`\> |
|
|
94
94
|
|
|
95
95
|
___
|
|
96
96
|
|
|
@@ -103,7 +103,7 @@ ___
|
|
|
103
103
|
| Name | Type |
|
|
104
104
|
| :------ | :------ |
|
|
105
105
|
| `body?` | `string` |
|
|
106
|
-
| `headers?` | { `[key: string]`: `string`; } |
|
|
106
|
+
| `headers?` | \{ `[key: string]`: `string`; } |
|
|
107
107
|
| `message?` | `string` |
|
|
108
108
|
| `statusCode?` | `number` |
|
|
109
109
|
|
|
@@ -130,43 +130,43 @@ ___
|
|
|
130
130
|
|
|
131
131
|
### ValidatorConfig
|
|
132
132
|
|
|
133
|
-
Ƭ **ValidatorConfig
|
|
133
|
+
Ƭ **ValidatorConfig**\<`TParams`, `TCookie`, `TSession`\>: `Object`
|
|
134
134
|
|
|
135
135
|
#### Type parameters
|
|
136
136
|
|
|
137
137
|
| Name | Type |
|
|
138
138
|
| :------ | :------ |
|
|
139
|
-
| `TParams` | extends `Record
|
|
140
|
-
| `TCookie` | extends `Record
|
|
141
|
-
| `TSession` | extends `Record
|
|
139
|
+
| `TParams` | extends `Record`\<`string`, `any`\> = `any` |
|
|
140
|
+
| `TCookie` | extends `Record`\<`string`, `string`\> = `any` |
|
|
141
|
+
| `TSession` | extends `Record`\<`string`, `string`\> = `any` |
|
|
142
142
|
|
|
143
143
|
#### Type declaration
|
|
144
144
|
|
|
145
145
|
| Name | Type |
|
|
146
146
|
| :------ | :------ |
|
|
147
147
|
| `before?` | `BeforeOption` |
|
|
148
|
-
| `cookie?` | [`ValidatorOptions`](#validatoroptions)
|
|
149
|
-
| `params?` | [`ValidatorOptions`](#validatoroptions)
|
|
150
|
-
| `session?` | [`ValidatorOptions`](#validatoroptions)
|
|
148
|
+
| `cookie?` | [`ValidatorOptions`](#validatoroptions)\<`TCookie`\> |
|
|
149
|
+
| `params?` | [`ValidatorOptions`](#validatoroptions)\<`TParams`\> |
|
|
150
|
+
| `session?` | [`ValidatorOptions`](#validatoroptions)\<`TSession`\> |
|
|
151
151
|
|
|
152
152
|
___
|
|
153
153
|
|
|
154
154
|
### ValidatorOptions
|
|
155
155
|
|
|
156
|
-
Ƭ **ValidatorOptions
|
|
156
|
+
Ƭ **ValidatorOptions**\<`Content`\>: `Object`
|
|
157
157
|
|
|
158
158
|
#### Type parameters
|
|
159
159
|
|
|
160
160
|
| Name | Type |
|
|
161
161
|
| :------ | :------ |
|
|
162
|
-
| `Content` | `Record
|
|
162
|
+
| `Content` | `Record`\<`string`, `any`\> |
|
|
163
163
|
|
|
164
164
|
#### Type declaration
|
|
165
165
|
|
|
166
166
|
| Name | Type |
|
|
167
167
|
| :------ | :------ |
|
|
168
|
-
| `onError?` | (`type`: `string`, `key`: `string` \| `string`[], `value?`: `any`) => { `message`: `any` ; `statusCode?`: `number` } \| `void` |
|
|
169
|
-
| `rules` | { [k in keyof Content]?: ValidatorRuleOptions } |
|
|
168
|
+
| `onError?` | (`type`: `string`, `key`: `string` \| `string`[], `value?`: `any`) => \{ `message`: `any` ; `statusCode?`: `number` } \| `void` |
|
|
169
|
+
| `rules` | \{ [k in keyof Content]?: ValidatorRuleOptions } |
|
|
170
170
|
| `whitelist?` | ``"error"`` \| ``"ignore"`` |
|
|
171
171
|
|
|
172
172
|
___
|
|
@@ -179,7 +179,7 @@ ___
|
|
|
179
179
|
|
|
180
180
|
| Name | Type |
|
|
181
181
|
| :------ | :------ |
|
|
182
|
-
| `config?` | `Partial
|
|
182
|
+
| `config?` | `Partial`\<[`ValidatorOptions`](#validatoroptions)\> |
|
|
183
183
|
| `default?` | `any` |
|
|
184
184
|
| `in?` | `any`[] |
|
|
185
185
|
| `regexp?` | `RegExp` |
|
|
@@ -200,22 +200,22 @@ ___
|
|
|
200
200
|
|
|
201
201
|
### useHttp
|
|
202
202
|
|
|
203
|
-
▸ **useHttp
|
|
203
|
+
▸ **useHttp**\<`TParams`, `TCookie`, `TSession`\>(`config?`): `UseifyPlugin`\<[`Http`](classes/Http.md)\<`TParams`, `TCookie`, `TSession`\>\>
|
|
204
204
|
|
|
205
205
|
#### Type parameters
|
|
206
206
|
|
|
207
207
|
| Name | Type |
|
|
208
208
|
| :------ | :------ |
|
|
209
|
-
| `TParams` | extends `Record
|
|
210
|
-
| `TCookie` | extends `Record
|
|
211
|
-
| `TSession` | extends `Record
|
|
209
|
+
| `TParams` | extends `Record`\<`string`, `any`\> = `any` |
|
|
210
|
+
| `TCookie` | extends `Record`\<`string`, `string`\> = `any` |
|
|
211
|
+
| `TSession` | extends `Record`\<`string`, `string`\> = `any` |
|
|
212
212
|
|
|
213
213
|
#### Parameters
|
|
214
214
|
|
|
215
215
|
| Name | Type |
|
|
216
216
|
| :------ | :------ |
|
|
217
|
-
| `config?` | [`HttpConfig`](#httpconfig)
|
|
217
|
+
| `config?` | [`HttpConfig`](#httpconfig)\<`TParams`, `TCookie`, `TSession`\> |
|
|
218
218
|
|
|
219
219
|
#### Returns
|
|
220
220
|
|
|
221
|
-
`UseifyPlugin
|
|
221
|
+
`UseifyPlugin`\<[`Http`](classes/Http.md)\<`TParams`, `TCookie`, `TSession`\>\>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/http",
|
|
3
|
-
"version": "0.0.4-beta.
|
|
3
|
+
"version": "0.0.4-beta.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@faasjs/func": "0.0.4-beta.
|
|
26
|
-
"@faasjs/logger": "0.0.4-beta.
|
|
25
|
+
"@faasjs/func": "0.0.4-beta.11",
|
|
26
|
+
"@faasjs/logger": "0.0.4-beta.11"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@faasjs/func": "0.0.4-beta.
|
|
30
|
-
"@faasjs/logger": "0.0.4-beta.
|
|
29
|
+
"@faasjs/func": "0.0.4-beta.11",
|
|
30
|
+
"@faasjs/logger": "0.0.4-beta.11"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"npm": ">=9.0.0",
|