@eduzz/miau-client 0.0.12 → 0.0.14
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/.turbo/turbo-build$colon$types.log +1 -1
- package/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-prepublish.log +1 -1
- package/dist/MiauClient.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +2 -2
- package/dist/miau-types/types/Application.d.ts +0 -2
- package/dist/miau-types/types/Secret.d.ts +5 -1
- package/dist/middleware.d.ts +6 -2
- package/package.json +1 -1
- package/src/MiauClient.ts +4 -4
- package/src/middleware.ts +5 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @eduzz/miau-client@0.0.
|
|
2
|
+
> @eduzz/miau-client@0.0.14 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.
|
|
7
|
+
dist/index.js.map 735.4kb
|
|
8
8
|
|
|
9
|
-
⚡ Done in
|
|
9
|
+
⚡ Done in 389ms
|
package/dist/MiauClient.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
11848
|
+
middleware(requestAugmentation, fallbackMidlleware) {
|
|
11849
11849
|
return miauMiddleware(this, requestAugmentation, fallbackMidlleware);
|
|
11850
11850
|
}
|
|
11851
11851
|
async getPermissions(targetAppId) {
|