@levrbet/shared 0.1.29 → 0.1.31

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.
@@ -0,0 +1 @@
1
+ export * from "./useAuthHeaders";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useAuthHeaders"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/hooks/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAgC"}
@@ -0,0 +1 @@
1
+ export * from "./auth";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./auth"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB"}
@@ -1,5 +1,2 @@
1
- export declare const useTestHook: () => {
2
- state: number;
3
- setState: import("react").Dispatch<import("react").SetStateAction<number>>;
4
- };
5
1
  export * from "../core";
2
+ export * from "./hooks";
@@ -14,12 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.useTestHook = void 0;
18
- const react_1 = require("react");
19
- const useTestHook = () => {
20
- const [state, setState] = (0, react_1.useState)(0);
21
- return { state, setState };
22
- };
23
- exports.useTestHook = useTestHook;
24
17
  __exportStar(require("../core"), exports);
18
+ __exportStar(require("./hooks"), exports);
25
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iCAAgC;AAEzB,MAAM,WAAW,GAAG,GAAG,EAAE;IAC5B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAA;IACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;AAC9B,CAAC,CAAA;AAHY,QAAA,WAAW,eAGvB;AAED,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,0CAAuB"}
@@ -1,17 +1,3 @@
1
1
  import type { NextFunction, Request, Response } from "express";
2
- /**
3
- * Creates authentication middleware for Privy token validation.
4
- *
5
- * This middleware validates Privy access tokens and ID tokens, authenticates users,
6
- * and sets the authenticated user context on the request object. It supports both
7
- * User and Admin authentication types.
8
- *
9
- * @param type - The authentication type, either "User" or "Admin"
10
- * @returns An Express middleware function that:
11
- * - Extracts Privy tokens and ETH address from request headers
12
- * - Validates the tokens using the appropriate Privy service method
13
- * - Sets `req.privyUser` and `req.ethAddress` properties on successful authentication
14
- * - Returns 401 Unauthorized response if authentication fails
15
- *
16
- */
17
- export declare const privyAuthMiddleware: (type: "User" | "Admin") => (req: Request, res: Response, next: NextFunction) => Promise<void>;
2
+ export declare const privyUserAuthMiddleware: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3
+ export declare const privyAdminAuthMiddleware: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.privyAuthMiddleware = void 0;
3
+ exports.privyAdminAuthMiddleware = exports.privyUserAuthMiddleware = void 0;
4
4
  const viem_1 = require("viem");
5
5
  const constants_1 = require("../../../core/constants");
6
6
  const privy_service_1 = require("../privy.service");
@@ -34,5 +34,6 @@ const privyAuthMiddleware = (type) => {
34
34
  next();
35
35
  };
36
36
  };
37
- exports.privyAuthMiddleware = privyAuthMiddleware;
37
+ exports.privyUserAuthMiddleware = privyAuthMiddleware("User");
38
+ exports.privyAdminAuthMiddleware = privyAuthMiddleware("Admin");
38
39
  //# sourceMappingURL=privy.middleware.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"privy.middleware.js","sourceRoot":"","sources":["../../../../src/server/auth/middleware/privy.middleware.ts"],"names":[],"mappings":";;;AACA,+BAA4C;AAC5C,uDAA8G;AAC9G,oDAA+C;AAE/C;;;;;;;;;;;;;;GAcG;AACI,MAAM,mBAAmB,GAAG,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