@faasjs/http 0.0.2-beta.323 → 0.0.2-beta.327
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/dist/index.js +12 -12
- package/dist/index.mjs +12 -12
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -53,14 +53,14 @@ var Session = class {
|
|
|
53
53
|
}, config);
|
|
54
54
|
this.secret = (0, import_crypto.pbkdf2Sync)(this.config.secret, this.config.salt, this.config.iterations, this.config.keylen / 2, this.config.digest);
|
|
55
55
|
this.signedSecret = (0, import_crypto.pbkdf2Sync)(this.config.secret, this.config.signedSalt, this.config.iterations, this.config.keylen, this.config.digest);
|
|
56
|
-
this.content = Object.create(null);
|
|
56
|
+
this.content = /* @__PURE__ */ Object.create(null);
|
|
57
57
|
}
|
|
58
58
|
invoke(cookie) {
|
|
59
59
|
try {
|
|
60
|
-
this.content = cookie ? this.decode(cookie) : Object.create(null);
|
|
60
|
+
this.content = cookie ? this.decode(cookie) : /* @__PURE__ */ Object.create(null);
|
|
61
61
|
} catch (error) {
|
|
62
62
|
console.error(error);
|
|
63
|
-
this.content = Object.create(null);
|
|
63
|
+
this.content = /* @__PURE__ */ Object.create(null);
|
|
64
64
|
}
|
|
65
65
|
this.changed = false;
|
|
66
66
|
}
|
|
@@ -124,11 +124,11 @@ var Cookie = class {
|
|
|
124
124
|
session: {}
|
|
125
125
|
}, config);
|
|
126
126
|
this.session = new Session(this, this.config.session);
|
|
127
|
-
this.content = Object.create(null);
|
|
128
|
-
this.setCookie = Object.create(null);
|
|
127
|
+
this.content = /* @__PURE__ */ Object.create(null);
|
|
128
|
+
this.setCookie = /* @__PURE__ */ Object.create(null);
|
|
129
129
|
}
|
|
130
130
|
invoke(cookie) {
|
|
131
|
-
this.content = Object.create(null);
|
|
131
|
+
this.content = /* @__PURE__ */ Object.create(null);
|
|
132
132
|
if (cookie)
|
|
133
133
|
cookie.split(";").forEach((x) => {
|
|
134
134
|
x = x.trim();
|
|
@@ -136,7 +136,7 @@ var Cookie = class {
|
|
|
136
136
|
if (k !== null)
|
|
137
137
|
this.content[k[0]] = decodeURIComponent(x.replace(`${k[0]}=`, "").replace(/;$/, ""));
|
|
138
138
|
});
|
|
139
|
-
this.setCookie = Object.create(null);
|
|
139
|
+
this.setCookie = /* @__PURE__ */ Object.create(null);
|
|
140
140
|
this.session.invoke(this.read(this.session.config.key));
|
|
141
141
|
return this;
|
|
142
142
|
}
|
|
@@ -335,11 +335,11 @@ var Http = class {
|
|
|
335
335
|
this.type = Name;
|
|
336
336
|
this.name = Name;
|
|
337
337
|
this.name = (config == null ? void 0 : config.name) || this.type;
|
|
338
|
-
this.config = (config == null ? void 0 : config.config) || Object.create(null);
|
|
338
|
+
this.config = (config == null ? void 0 : config.config) || /* @__PURE__ */ Object.create(null);
|
|
339
339
|
if (config == null ? void 0 : config.validator)
|
|
340
340
|
this.validatorOptions = config.validator;
|
|
341
341
|
this.logger = new import_logger.Logger(this.name);
|
|
342
|
-
this.headers = Object.create(null);
|
|
342
|
+
this.headers = /* @__PURE__ */ Object.create(null);
|
|
343
343
|
this.cookie = new Cookie(this.config.cookie || {});
|
|
344
344
|
this.session = this.cookie.session;
|
|
345
345
|
}
|
|
@@ -379,10 +379,10 @@ var Http = class {
|
|
|
379
379
|
}
|
|
380
380
|
async onInvoke(data, next) {
|
|
381
381
|
var _a, _b;
|
|
382
|
-
this.headers = data.event.headers || Object.create(null);
|
|
382
|
+
this.headers = data.event.headers || /* @__PURE__ */ Object.create(null);
|
|
383
383
|
this.body = data.event.body;
|
|
384
|
-
this.params = Object.create(null);
|
|
385
|
-
this.response = { headers: Object.create(null) };
|
|
384
|
+
this.params = /* @__PURE__ */ Object.create(null);
|
|
385
|
+
this.response = { headers: /* @__PURE__ */ Object.create(null) };
|
|
386
386
|
if (data.event.body) {
|
|
387
387
|
if (data.event.headers && data.event.headers["content-type"] && data.event.headers["content-type"].includes("application/json")) {
|
|
388
388
|
this.logger.debug("[onInvoke] Parse params from json body");
|
package/dist/index.mjs
CHANGED
|
@@ -36,14 +36,14 @@ var Session = class {
|
|
|
36
36
|
}, config);
|
|
37
37
|
this.secret = pbkdf2Sync(this.config.secret, this.config.salt, this.config.iterations, this.config.keylen / 2, this.config.digest);
|
|
38
38
|
this.signedSecret = pbkdf2Sync(this.config.secret, this.config.signedSalt, this.config.iterations, this.config.keylen, this.config.digest);
|
|
39
|
-
this.content = Object.create(null);
|
|
39
|
+
this.content = /* @__PURE__ */ Object.create(null);
|
|
40
40
|
}
|
|
41
41
|
invoke(cookie) {
|
|
42
42
|
try {
|
|
43
|
-
this.content = cookie ? this.decode(cookie) : Object.create(null);
|
|
43
|
+
this.content = cookie ? this.decode(cookie) : /* @__PURE__ */ Object.create(null);
|
|
44
44
|
} catch (error) {
|
|
45
45
|
console.error(error);
|
|
46
|
-
this.content = Object.create(null);
|
|
46
|
+
this.content = /* @__PURE__ */ Object.create(null);
|
|
47
47
|
}
|
|
48
48
|
this.changed = false;
|
|
49
49
|
}
|
|
@@ -107,11 +107,11 @@ var Cookie = class {
|
|
|
107
107
|
session: {}
|
|
108
108
|
}, config);
|
|
109
109
|
this.session = new Session(this, this.config.session);
|
|
110
|
-
this.content = Object.create(null);
|
|
111
|
-
this.setCookie = Object.create(null);
|
|
110
|
+
this.content = /* @__PURE__ */ Object.create(null);
|
|
111
|
+
this.setCookie = /* @__PURE__ */ Object.create(null);
|
|
112
112
|
}
|
|
113
113
|
invoke(cookie) {
|
|
114
|
-
this.content = Object.create(null);
|
|
114
|
+
this.content = /* @__PURE__ */ Object.create(null);
|
|
115
115
|
if (cookie)
|
|
116
116
|
cookie.split(";").forEach((x) => {
|
|
117
117
|
x = x.trim();
|
|
@@ -119,7 +119,7 @@ var Cookie = class {
|
|
|
119
119
|
if (k !== null)
|
|
120
120
|
this.content[k[0]] = decodeURIComponent(x.replace(`${k[0]}=`, "").replace(/;$/, ""));
|
|
121
121
|
});
|
|
122
|
-
this.setCookie = Object.create(null);
|
|
122
|
+
this.setCookie = /* @__PURE__ */ Object.create(null);
|
|
123
123
|
this.session.invoke(this.read(this.session.config.key));
|
|
124
124
|
return this;
|
|
125
125
|
}
|
|
@@ -322,11 +322,11 @@ var Http = class {
|
|
|
322
322
|
this.type = Name;
|
|
323
323
|
this.name = Name;
|
|
324
324
|
this.name = (config == null ? void 0 : config.name) || this.type;
|
|
325
|
-
this.config = (config == null ? void 0 : config.config) || Object.create(null);
|
|
325
|
+
this.config = (config == null ? void 0 : config.config) || /* @__PURE__ */ Object.create(null);
|
|
326
326
|
if (config == null ? void 0 : config.validator)
|
|
327
327
|
this.validatorOptions = config.validator;
|
|
328
328
|
this.logger = new Logger(this.name);
|
|
329
|
-
this.headers = Object.create(null);
|
|
329
|
+
this.headers = /* @__PURE__ */ Object.create(null);
|
|
330
330
|
this.cookie = new Cookie(this.config.cookie || {});
|
|
331
331
|
this.session = this.cookie.session;
|
|
332
332
|
}
|
|
@@ -366,10 +366,10 @@ var Http = class {
|
|
|
366
366
|
}
|
|
367
367
|
async onInvoke(data, next) {
|
|
368
368
|
var _a, _b;
|
|
369
|
-
this.headers = data.event.headers || Object.create(null);
|
|
369
|
+
this.headers = data.event.headers || /* @__PURE__ */ Object.create(null);
|
|
370
370
|
this.body = data.event.body;
|
|
371
|
-
this.params = Object.create(null);
|
|
372
|
-
this.response = { headers: Object.create(null) };
|
|
371
|
+
this.params = /* @__PURE__ */ Object.create(null);
|
|
372
|
+
this.response = { headers: /* @__PURE__ */ Object.create(null) };
|
|
373
373
|
if (data.event.body) {
|
|
374
374
|
if (data.event.headers && data.event.headers["content-type"] && data.event.headers["content-type"].includes("application/json")) {
|
|
375
375
|
this.logger.debug("[onInvoke] Parse params from json body");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/http",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.327",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
},
|
|
17
17
|
"funding": "https://github.com/sponsors/faasjs",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "tsup-node src/index.ts --format esm,cjs",
|
|
20
|
+
"build:types": "tsup-node src/index.ts --dts-only"
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"dist"
|
|
23
24
|
],
|
|
24
25
|
"peerDependencies": {
|
|
25
|
-
"@faasjs/func": "^0.0.2-beta.
|
|
26
|
-
"@faasjs/logger": "^0.0.2-beta.
|
|
26
|
+
"@faasjs/func": "^0.0.2-beta.327",
|
|
27
|
+
"@faasjs/logger": "^0.0.2-beta.327"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"tsup": "*",
|
|
@@ -31,6 +32,5 @@
|
|
|
31
32
|
},
|
|
32
33
|
"engines": {
|
|
33
34
|
"npm": ">=8.0.0"
|
|
34
|
-
}
|
|
35
|
-
"gitHead": "4a9f699171ad7e20d922e68b74418d1ec5b7d016"
|
|
35
|
+
}
|
|
36
36
|
}
|