@hellocoop/express 1.8.5 → 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 CHANGED
@@ -1,4 +1,5 @@
1
1
  import { auth, HelloConfig } from './auth';
2
2
  export default auth;
3
3
  export { auth as helloAuth, HelloConfig };
4
+ export { redirect, unauthorized, setAuth } from './middleware';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -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.8.5",
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
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=server.d.ts.map
@@ -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
- });