@hellocoop/express 1.8.7 → 1.9.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/package.json +2 -3
- package/dist/server.d.ts +0 -2
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -29
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC1C,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,WAAW,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC1C,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,WAAW,EAAE,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.helloAuth = void 0;
|
|
3
|
+
exports.setAuth = exports.unauthorized = exports.redirect = exports.helloAuth = void 0;
|
|
4
4
|
const auth_1 = require("./auth");
|
|
5
5
|
Object.defineProperty(exports, "helloAuth", { enumerable: true, get: function () { return auth_1.auth; } });
|
|
6
6
|
exports.default = auth_1.auth;
|
|
7
|
+
var middleware_1 = require("./middleware");
|
|
8
|
+
Object.defineProperty(exports, "redirect", { enumerable: true, get: function () { return middleware_1.redirect; } });
|
|
9
|
+
Object.defineProperty(exports, "unauthorized", { enumerable: true, get: function () { return middleware_1.unauthorized; } });
|
|
10
|
+
Object.defineProperty(exports, "setAuth", { enumerable: true, get: function () { return middleware_1.setAuth; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hellocoop/express",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Express SDK for Hellō https://hello.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
|
-
".": "./dist/index.js"
|
|
14
|
-
"./middleware": "./dist/middleware.js"
|
|
13
|
+
".": "./dist/index.js"
|
|
15
14
|
},
|
|
16
15
|
"files": [
|
|
17
16
|
"dist/"
|
package/dist/server.d.ts
DELETED
package/dist/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}
|
package/dist/server.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
// test server
|
|
7
|
-
const express_1 = __importDefault(require("express"));
|
|
8
|
-
const index_1 = require("./index");
|
|
9
|
-
const middleware_1 = require("./middleware");
|
|
10
|
-
const config = require('../hello.config.js');
|
|
11
|
-
const app = (0, express_1.default)();
|
|
12
|
-
const port = 8080; // default port to listen
|
|
13
|
-
app.use((0, index_1.helloAuth)(config));
|
|
14
|
-
app.get("/", async (req, res) => {
|
|
15
|
-
res.json(await req.getAuth());
|
|
16
|
-
});
|
|
17
|
-
app.get("/redirect", (0, middleware_1.redirect)('/'), async (req, res) => {
|
|
18
|
-
res.json(await req.getAuth());
|
|
19
|
-
});
|
|
20
|
-
app.get("/unauthorized", middleware_1.unauthorized, async (req, res) => {
|
|
21
|
-
res.json(await req.getAuth());
|
|
22
|
-
});
|
|
23
|
-
app.get("/setAuth", middleware_1.setAuth, (req, res) => {
|
|
24
|
-
res.json(req.auth);
|
|
25
|
-
});
|
|
26
|
-
// start the Express server
|
|
27
|
-
app.listen(port, () => {
|
|
28
|
-
console.log(`server started at http://localhost:${port}`);
|
|
29
|
-
});
|