@hellocoop/express 1.16.1 → 1.17.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAsB,MAAM,SAAS,CAAA;AAEvE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAIH,iBAAiB,EACjB,kBAAkB,EAKlB,MAAM,EAET,MAAM,gBAAgB,CAAA;AAGvB,KAAK,kBAAkB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,KAAK,mBAAmB,GAAG;IACvB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAA;CAChB,CAAA;AAED,KAAK,gBAAgB,GAAG,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAClF,KAAK,iBAAiB,GAAG,CAAC,MAAM,EAAE,mBAAmB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAErF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAAC,GAAG;IACjE,SAAS,EAAE,gBAAgB,CAAC;IAC5B,UAAU,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAuDF,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,OAAO,CAAC;QAChB,UAAU,OAAO;YACf,IAAI,CAAC,EAAE,IAAI,CAAC;YACZ,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;SAC1B;QACD,UAAU,QAAQ;YAChB,SAAS,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;CACF;AAmBH,eAAO,MAAM,IAAI,WAAsB,MAAM,KAAG,MAkC/C,CAAA"}
package/dist/auth.js CHANGED
@@ -1,9 +1,16 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.auth = void 0;
4
7
  const express_1 = require("express");
5
8
  const cookie_1 = require("cookie");
6
9
  const api_1 = require("@hellocoop/api");
10
+ // set name and version to provide in metadata
11
+ const package_json_1 = __importDefault(require("../package.json"));
12
+ const { name, version } = package_json_1.default;
13
+ api_1.PackageMetadata.setMetadata(name, version);
7
14
  const convertToHelloRequest = (req, res) => {
8
15
  return {
9
16
  headers: () => req.headers,
@@ -75,6 +82,7 @@ const auth = function (config) {
75
82
  }
76
83
  console.log({ isConfigured: api_1.isConfigured, configuration: api_1.configuration });
77
84
  const r = (0, express_1.Router)();
85
+ r.use((0, express_1.urlencoded)({ extended: true })); // Parse application/x-www-form-urlencoded
78
86
  r.use(async (req, res, next) => {
79
87
  const helloReq = convertToHelloRequest(req, res);
80
88
  req.getAuth = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hellocoop/express",
3
- "version": "1.16.1",
3
+ "version": "1.17.1",
4
4
  "description": "Express SDK for Hellō https://hello.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,12 +57,12 @@
57
57
  "node": ">=18"
58
58
  },
59
59
  "dependencies": {
60
- "@hellocoop/api": "^2.1.1",
60
+ "@hellocoop/api": "^2.2.1",
61
61
  "@hellocoop/definitions": "^1.0.9",
62
- "@hellocoop/helper-server": "^2.1.3",
62
+ "@hellocoop/helper-server": "^2.2.1",
63
63
  "cookie": "^1.0.1",
64
64
  "cors": "^2.8.5",
65
65
  "dotenv": "^16.3.1"
66
66
  },
67
- "gitHead": "313660c6d341d486fb79b45c741ce8fda5acbb45"
67
+ "gitHead": "3d2e3dfbe982218f8abfce50126b2463fceb5831"
68
68
  }