@entur-partner/bff 1.2.1 → 1.2.2

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,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var r=e(require("express-http-proxy")),t=function(e,r){var t=Array.isArray(e)?e:[e];return{filter:function(e){return t.includes(e.method)&&function(e){return/(^undefined$)|(^Bearer .+$)/gim.test(e.headers.authorization||"")}(e)},proxyReqPathResolver:r,proxyReqBodyDecorator:function(e,r){return e},limit:(process.env.UPLOAD_LIMIT_MB||200)+"mb"}},n=function(e){return e.endsWith("/")?e.substring(0,e.length-1):e};exports.forwardingProxy=function(e){return function(o,u){return r.default(e,t(o,(function(){return n(new URL(e).pathname)+u.apply(void 0,arguments)})))}},exports.proxyConfig=t;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var r=e(require("express-http-proxy")),t=function(e,r){var t=Array.isArray(e)?e:[e];return{filter:function(e){return t.includes(e.method)&&function(e){return/(^undefined$)|(^Bearer .+$)/gim.test(e.headers.authorization||"")}(e)},proxyReqPathResolver:r,proxyReqBodyDecorator:function(e,r){return e},limit:(process.env.UPLOAD_LIMIT_MB||200)+"mb"}};exports.forwardingProxy=function(e){return function(n,o){return r.default(e,t(n,(function(){return((r=new URL(e).pathname).endsWith("/")?r.substring(0,r.length-1):r)+o.apply(void 0,arguments);var r})))}},exports.proxyConfig=t;
2
2
  //# sourceMappingURL=bff.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bff.cjs.production.min.js","sources":["../src/forwardingproxy.ts"],"sourcesContent":["import proxy, { ProxyOptions } from 'express-http-proxy';\nimport { Request } from 'express';\n\nconst requireOAuth = (req: Request) =>\n /(^undefined$)|(^Bearer .+$)/gim.test(req.headers.authorization || '');\n\nexport const proxyConfig = (\n methods: string[],\n proxyReqPathResolver: Required<ProxyOptions>['proxyReqPathResolver']\n): Parameters<typeof proxy>[1] => {\n const httpMethods = Array.isArray(methods) ? methods : [methods];\n\n return {\n filter: (req: Request) =>\n httpMethods.includes(req.method) && requireOAuth(req),\n proxyReqPathResolver,\n proxyReqBodyDecorator: (bodyContent, _srcReq) => bodyContent,\n limit: `${process.env.UPLOAD_LIMIT_MB || 200}mb`,\n };\n};\n\nconst stripTrailingSlash = (url: string) =>\n url.endsWith('/') ? url.substring(0, url.length - 1) : url;\n\n// forwards a call of a specific url / set of methods to a remote server\nexport const forwardingProxy =\n (apiUrl: string) =>\n (method: string[], forwardPath: (...reqs: Request[]) => string) =>\n proxy(\n apiUrl,\n proxyConfig(\n method,\n (...params) =>\n stripTrailingSlash(new URL(apiUrl).pathname) + forwardPath(...params)\n )\n );\n"],"names":["proxyConfig","methods","proxyReqPathResolver","httpMethods","Array","isArray","filter","req","includes","method","test","headers","authorization","requireOAuth","proxyReqBodyDecorator","bodyContent","_srcReq","limit","process","env","UPLOAD_LIMIT_MB","stripTrailingSlash","url","endsWith","substring","length","apiUrl","forwardPath","proxy","URL","pathname","apply","arguments"],"mappings":"mLAMaA,EAAc,SACzBC,EACAC,GAEA,IAAMC,EAAcC,MAAMC,QAAQJ,GAAWA,EAAU,CAACA,GAExD,MAAO,CACLK,OAAQ,SAACC,GAAY,OACnBJ,EAAYK,SAASD,EAAIE,SAXV,SAACF,GAAY,MAChC,iCAAiCG,KAAKH,EAAII,QAAQC,eAAiB,IAU3BC,CAAaN,IACnDL,qBAAAA,EACAY,sBAAuB,SAACC,EAAaC,GAAO,OAAKD,GACjDE,OAAUC,QAAQC,IAAIC,iBAAmB,KAAG,OAI1CC,EAAqB,SAACC,GAAW,OACrCA,EAAIC,SAAS,KAAOD,EAAIE,UAAU,EAAGF,EAAIG,OAAS,GAAKH,2BAIvD,SAACI,GAAc,OACf,SAACjB,EAAkBkB,GAA2C,OAC5DC,UACEF,EACA1B,EACES,GACA,WAAA,OACEY,EAAmB,IAAIQ,IAAIH,GAAQI,UAAYH,EAAWI,WAAA,EAAAC"}
1
+ {"version":3,"file":"bff.cjs.production.min.js","sources":["../src/forwardingproxy.ts"],"sourcesContent":["import proxy, { ProxyOptions } from 'express-http-proxy';\nimport { Request } from 'express';\n\nconst requireOAuth = (req: Request) =>\n /(^undefined$)|(^Bearer .+$)/gim.test(req.headers.authorization || '');\n\nexport const proxyConfig = (\n methods: string[],\n proxyReqPathResolver: Required<ProxyOptions>['proxyReqPathResolver']\n): Parameters<typeof proxy>[1] => {\n const httpMethods = Array.isArray(methods) ? methods : [methods];\n\n return {\n filter: (req: Request) =>\n httpMethods.includes(req.method) && requireOAuth(req),\n proxyReqPathResolver,\n proxyReqBodyDecorator: (bodyContent, _srcReq) => bodyContent,\n limit: `${process.env.UPLOAD_LIMIT_MB || 200}mb`,\n };\n};\n\nconst stripTrailingSlash = (url: string) =>\n url.endsWith('/') ? url.substring(0, url.length - 1) : url;\n\n// forwards a call of a specific url / set of methods to a remote server\nexport const forwardingProxy =\n (apiUrl: string) =>\n (method: string[], forwardPath: (...reqs: Request[]) => string) =>\n proxy(\n apiUrl,\n proxyConfig(\n method,\n (...params) =>\n stripTrailingSlash(new URL(apiUrl).pathname) + forwardPath(...params)\n )\n );\n"],"names":["proxyConfig","methods","proxyReqPathResolver","httpMethods","Array","isArray","filter","req","includes","method","test","headers","authorization","requireOAuth","proxyReqBodyDecorator","bodyContent","_srcReq","limit","process","env","UPLOAD_LIMIT_MB","apiUrl","forwardPath","proxy","url","URL","pathname","endsWith","substring","length","apply","arguments"],"mappings":"mLAMaA,EAAc,SACzBC,EACAC,GAEA,IAAMC,EAAcC,MAAMC,QAAQJ,GAAWA,EAAU,CAACA,GAExD,MAAO,CACLK,OAAQ,SAACC,GAAY,OACnBJ,EAAYK,SAASD,EAAIE,SAXV,SAACF,GAAY,MAChC,iCAAiCG,KAAKH,EAAII,QAAQC,eAAiB,GAAG,CAU9BC,CAAaN,EAAI,EACvDL,qBAAAA,EACAY,sBAAuB,SAACC,EAAaC,GAAO,OAAKD,CAAW,EAC5DE,OAAUC,QAAQC,IAAIC,iBAAmB,KAAG,KAEhD,0BAOE,SAACC,GAAc,OACf,SAACZ,EAAkBa,GAA2C,OAC5DC,UACEF,EACArB,EACES,GACA,WAAA,QAXoBe,EAYC,IAAIC,IAAIJ,GAAQK,UAXvCC,SAAS,KAAOH,EAAII,UAAU,EAAGJ,EAAIK,OAAS,GAAKL,GAWAF,EAAWQ,WAAA,EAAAC,WAZzC,IAACP,CAYmD,IAE1E,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur-partner/bff",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/bff.esm.js",
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "https://bitbucket.org/enturas/entur-partner-packages.git",
13
+ "url": "https://github.com/entur/entur-partner-packages.git",
14
14
  "directory": "packages/bff"
15
15
  },
16
16
  "publishConfig": {
@@ -38,5 +38,5 @@
38
38
  "reportFile": "jest-sonar-report.xml",
39
39
  "indent": 4
40
40
  },
41
- "gitHead": "c691310480d1a3416eb5d2d2a3a7ceaba47ffda1"
41
+ "gitHead": "d80524acda1e959d9f3d4002c664f9f8ce5ff74d"
42
42
  }