@eduzz/miau-client 0.0.12 → 0.0.13

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,4 +1,4 @@
1
1
 
2
- > @eduzz/miau-client@0.0.12 build:types /home/runner/work/eduzz-miau/eduzz-miau/packages/client
2
+ > @eduzz/miau-client@0.0.13 build:types /home/runner/work/eduzz-miau/eduzz-miau/packages/client
3
3
  > tsc --emitDeclarationOnly --outDir dist
4
4
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @eduzz/miau-client@0.0.12 build /home/runner/work/eduzz-miau/eduzz-miau/packages/client
2
+ > @eduzz/miau-client@0.0.13 build /home/runner/work/eduzz-miau/eduzz-miau/packages/client
3
3
  > esbuild src/index.ts --bundle --sourcemap --platform=node --target=es2020 --outfile=dist/index.js
4
4
 
5
5
 
6
6
  dist/index.js 438.5kb
7
- dist/index.js.map 735.5kb
7
+ dist/index.js.map 735.4kb
8
8
 
9
- ⚡ Done in 450ms
9
+ ⚡ Done in 459ms
@@ -1,4 +1,4 @@
1
1
 
2
- > @eduzz/miau-client@0.0.12 prepublish /home/runner/work/eduzz-miau/eduzz-miau/packages/client
2
+ > @eduzz/miau-client@0.0.13 prepublish /home/runner/work/eduzz-miau/eduzz-miau/packages/client
3
3
  > sh ./scripts/prepare-publish.sh
4
4
 
@@ -15,7 +15,7 @@ export declare class MiauClient {
15
15
  constructor(props: MiauClientConfig);
16
16
  getPublicKey(kid: string): Promise<string>;
17
17
  getToken(): Promise<string | undefined>;
18
- middleware(requestAugmentation?: RequestAugmentation | null, fallbackMidlleware?: RequestHandler | null): RequestHandler;
18
+ middleware<T = Record<string, string>>(requestAugmentation?: RequestAugmentation<T>, fallbackMidlleware?: RequestHandler): RequestHandler;
19
19
  getPermissions(targetAppId: string): Promise<Permission>;
20
20
  private requestPermissions;
21
21
  private getApiJwtUrl;
package/dist/index.js CHANGED
@@ -11743,7 +11743,7 @@ var wildcardToRegex = (pattern) => {
11743
11743
  const regexStr = `^${withWildcards}$`;
11744
11744
  return new RegExp(regexStr);
11745
11745
  };
11746
- var miauMiddleware = (miauClient, requestAugmentation = null, fallbackMidlleware = null) => {
11746
+ var miauMiddleware = (miauClient, requestAugmentation, fallbackMidlleware) => {
11747
11747
  return async (req, res, next) => {
11748
11748
  try {
11749
11749
  const token = req.headers.authorization?.split(" ").pop();
@@ -11774,7 +11774,7 @@ var miauMiddleware = (miauClient, requestAugmentation = null, fallbackMidlleware
11774
11774
  req.miauMetadata = permission?.metadata || {};
11775
11775
  if (requestAugmentation) {
11776
11776
  console.log("Request augmentation is being applied");
11777
- requestAugmentation(req, req.miauApplication, req.miauMetadata);
11777
+ requestAugmentation({ req, app: req.miauApplication, meta: req.miauMetadata });
11778
11778
  }
11779
11779
  next();
11780
11780
  } catch (err) {
@@ -11845,7 +11845,7 @@ var MiauClient = class {
11845
11845
  this.jwtToken = (await response.json()).jwt;
11846
11846
  return this.jwtToken;
11847
11847
  }
11848
- middleware(requestAugmentation = null, fallbackMidlleware = null) {
11848
+ middleware(requestAugmentation, fallbackMidlleware) {
11849
11849
  return miauMiddleware(this, requestAugmentation, fallbackMidlleware);
11850
11850
  }
11851
11851
  async getPermissions(targetAppId) {