@faasjs/http 0.0.2-beta.362 → 0.0.2-beta.366

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 CHANGED
@@ -1,12 +1,14 @@
1
1
  # @faasjs/http
2
2
 
3
- http 插件
4
-
5
3
  [![License: MIT](https://img.shields.io/npm/l/@faasjs/http.svg)](https://github.com/faasjs/faasjs/blob/main/packages/faasjs/http/LICENSE)
6
4
  [![NPM Stable Version](https://img.shields.io/npm/v/@faasjs/http/stable.svg)](https://www.npmjs.com/package/@faasjs/http)
7
5
  [![NPM Beta Version](https://img.shields.io/npm/v/@faasjs/http/beta.svg)](https://www.npmjs.com/package/@faasjs/http)
8
6
 
9
- https://faasjs.com/doc/http.html
7
+ FaasJS's http plugin.
8
+
9
+ ## Install
10
+
11
+ npm install @faasjs/http
10
12
 
11
13
  ## Modules
12
14
 
@@ -20,21 +22,21 @@ https://faasjs.com/doc/http.html
20
22
 
21
23
  ### Type aliases
22
24
 
23
- - [CookieOptions](modules.md#cookieoptions)
24
- - [HttpConfig](modules.md#httpconfig)
25
- - [Response](modules.md#response)
26
- - [SessionOptions](modules.md#sessionoptions)
27
- - [ValidatorConfig](modules.md#validatorconfig)
28
- - [ValidatorOptions](modules.md#validatoroptions)
29
- - [ValidatorRuleOptions](modules.md#validatorruleoptions)
25
+ - [CookieOptions](#cookieoptions)
26
+ - [HttpConfig](#httpconfig)
27
+ - [Response](#response)
28
+ - [SessionOptions](#sessionoptions)
29
+ - [ValidatorConfig](#validatorconfig)
30
+ - [ValidatorOptions](#validatoroptions)
31
+ - [ValidatorRuleOptions](#validatorruleoptions)
30
32
 
31
33
  ### Variables
32
34
 
33
- - [ContentType](modules.md#contenttype)
35
+ - [ContentType](#contenttype)
34
36
 
35
37
  ### Functions
36
38
 
37
- - [useHttp](modules.md#usehttp)
39
+ - [useHttp](#usehttp)
38
40
 
39
41
  ## Type aliases
40
42
 
@@ -56,7 +58,7 @@ https://faasjs.com/doc/http.html
56
58
  | `path?` | `string` |
57
59
  | `sameSite?` | ``"Strict"`` \| ``"Lax"`` \| ``"None"`` |
58
60
  | `secure?` | `boolean` |
59
- | `session?` | [`SessionOptions`](modules.md#sessionoptions) |
61
+ | `session?` | [`SessionOptions`](#sessionoptions) |
60
62
 
61
63
  ___
62
64
 
@@ -80,15 +82,15 @@ ___
80
82
 
81
83
  | Name | Type |
82
84
  | :------ | :------ |
83
- | `config?` | `Object` |
84
- | `config.cookie?` | [`CookieOptions`](modules.md#cookieoptions) |
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
+ | `config.cookie?` | [`CookieOptions`](#cookieoptions) |
85
87
  | `config.functionName?` | `string` |
86
88
  | `config.ignorePathPrefix?` | `string` |
87
89
  | `config.method?` | ``"BEGIN"`` \| ``"GET"`` \| ``"POST"`` \| ``"DELETE"`` \| ``"HEAD"`` \| ``"PUT"`` \| ``"OPTIONS"`` \| ``"TRACE"`` \| ``"PATCH"`` \| ``"ANY"`` |
88
90
  | `config.path?` | `string` |
89
91
  | `config.timeout?` | `number` |
90
92
  | `name?` | `string` |
91
- | `validator?` | [`ValidatorConfig`](modules.md#validatorconfig)<`TParams`, `TCookie`, `TSession`\> |
93
+ | `validator?` | [`ValidatorConfig`](#validatorconfig)<`TParams`, `TCookie`, `TSession`\> |
92
94
 
93
95
  ___
94
96
 
@@ -101,7 +103,7 @@ ___
101
103
  | Name | Type |
102
104
  | :------ | :------ |
103
105
  | `body?` | `string` |
104
- | `headers?` | `Object` |
106
+ | `headers?` | { [key: string]: `string`; } |
105
107
  | `message?` | `string` |
106
108
  | `statusCode?` | `number` |
107
109
 
@@ -143,9 +145,9 @@ ___
143
145
  | Name | Type |
144
146
  | :------ | :------ |
145
147
  | `before?` | `BeforeOption` |
146
- | `cookie?` | [`ValidatorOptions`](modules.md#validatoroptions)<`TCookie`\> |
147
- | `params?` | [`ValidatorOptions`](modules.md#validatoroptions)<`TParams`\> |
148
- | `session?` | [`ValidatorOptions`](modules.md#validatoroptions)<`TSession`\> |
148
+ | `cookie?` | [`ValidatorOptions`](#validatoroptions)<`TCookie`\> |
149
+ | `params?` | [`ValidatorOptions`](#validatoroptions)<`TParams`\> |
150
+ | `session?` | [`ValidatorOptions`](#validatoroptions)<`TSession`\> |
149
151
 
150
152
  ___
151
153
 
@@ -177,7 +179,7 @@ ___
177
179
 
178
180
  | Name | Type |
179
181
  | :------ | :------ |
180
- | `config?` | `Partial`<[`ValidatorOptions`](modules.md#validatoroptions)\> |
182
+ | `config?` | `Partial`<[`ValidatorOptions`](#validatoroptions)\> |
181
183
  | `default?` | `any` |
182
184
  | `in?` | `any`[] |
183
185
  | `regexp?` | `RegExp` |
@@ -212,7 +214,7 @@ ___
212
214
 
213
215
  | Name | Type |
214
216
  | :------ | :------ |
215
- | `config?` | [`HttpConfig`](modules.md#httpconfig)<`TParams`, `TCookie`, `TSession`\> |
217
+ | `config?` | [`HttpConfig`](#httpconfig)<`TParams`, `TCookie`, `TSession`\> |
216
218
 
217
219
  #### Returns
218
220
 
package/dist/index.d.ts CHANGED
@@ -33,8 +33,8 @@ declare class Session<S extends Record<string, string> = any, C extends Record<s
33
33
  constructor(cookie: Cookie<C, S>, config: SessionOptions);
34
34
  invoke(cookie?: string): void;
35
35
  encode(text: SessionContent): string;
36
- decode(text: string): SessionContent;
37
- read(key: string): string;
36
+ decode<TData = any>(text: string): TData | SessionContent;
37
+ read(key: string): string | number;
38
38
  write(key: string, value?: string | number | null): Session<S, C>;
39
39
  update(): Session<S, C>;
40
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/http",
3
- "version": "0.0.2-beta.362",
3
+ "version": "0.0.2-beta.366",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,8 +22,8 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@faasjs/func": "^0.0.2-beta.362",
26
- "@faasjs/logger": "^0.0.2-beta.362"
25
+ "@faasjs/func": "^0.0.2-beta.366",
26
+ "@faasjs/logger": "^0.0.2-beta.366"
27
27
  },
28
28
  "devDependencies": {
29
29
  "tsup": "*",