@innvoid/getmarket-sdk 0.1.4 → 0.1.6

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.
Files changed (57) hide show
  1. package/dist/cache/index.js +0 -1
  2. package/dist/chunk-JXOLNJ7J.js +224 -0
  3. package/dist/chunk-JXOLNJ7J.js.map +1 -0
  4. package/dist/chunk-KJ64O2EG.js +19 -0
  5. package/dist/chunk-KJ64O2EG.js.map +1 -0
  6. package/dist/{chunk-GG7EI74E.js → chunk-OSYBK5AN.js} +5 -3
  7. package/dist/chunk-OSYBK5AN.js.map +1 -0
  8. package/dist/chunk-P2U3MT2E.js +39 -0
  9. package/dist/chunk-P2U3MT2E.js.map +1 -0
  10. package/dist/core/index.cjs +4 -2
  11. package/dist/core/index.cjs.map +1 -1
  12. package/dist/core/index.d.cts +1 -2
  13. package/dist/core/index.d.ts +1 -2
  14. package/dist/core/index.js +2 -4
  15. package/dist/express.cjs +19 -0
  16. package/dist/express.cjs.map +1 -0
  17. package/dist/express.d.cts +12 -0
  18. package/dist/express.d.ts +12 -0
  19. package/dist/express.js +1 -0
  20. package/dist/headers/index.cjs +12 -6
  21. package/dist/headers/index.cjs.map +1 -1
  22. package/dist/headers/index.d.cts +3 -18
  23. package/dist/headers/index.d.ts +3 -18
  24. package/dist/headers/index.js +1 -2
  25. package/dist/index.cjs +138 -51
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +34 -6
  28. package/dist/index.d.ts +34 -6
  29. package/dist/index.js +147 -14
  30. package/dist/index.js.map +1 -1
  31. package/dist/middlewares/index.cjs +133 -35
  32. package/dist/middlewares/index.cjs.map +1 -1
  33. package/dist/middlewares/index.d.cts +43 -14
  34. package/dist/middlewares/index.d.ts +43 -14
  35. package/dist/middlewares/index.js +9 -4
  36. package/dist/parse-C4vk-fmH.d.cts +16 -0
  37. package/dist/parse-C4vk-fmH.d.ts +16 -0
  38. package/dist/types-CRECQuHp.d.cts +54 -0
  39. package/dist/types-CRECQuHp.d.ts +54 -0
  40. package/package.json +6 -1
  41. package/dist/auth/index.cjs +0 -181
  42. package/dist/auth/index.cjs.map +0 -1
  43. package/dist/auth/index.d.cts +0 -3
  44. package/dist/auth/index.d.ts +0 -3
  45. package/dist/auth/index.js +0 -12
  46. package/dist/chunk-65HACONF.js +0 -33
  47. package/dist/chunk-65HACONF.js.map +0 -1
  48. package/dist/chunk-GG7EI74E.js.map +0 -1
  49. package/dist/chunk-PZ5AY32C.js +0 -10
  50. package/dist/chunk-PZ5AY32C.js.map +0 -1
  51. package/dist/chunk-W23UYULS.js +0 -156
  52. package/dist/chunk-W23UYULS.js.map +0 -1
  53. package/dist/chunk-Y2JJLHAY.js +0 -149
  54. package/dist/chunk-Y2JJLHAY.js.map +0 -1
  55. package/dist/index-WbfzvmOt.d.cts +0 -87
  56. package/dist/index-WbfzvmOt.d.ts +0 -87
  57. /package/dist/{auth/index.js.map → express.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/middlewares/requestId.ts","../src/middlewares/parseHeaders.ts","../src/middlewares/internalAuth.ts","../src/middlewares/respond.ts","../src/middlewares/autorization.ts"],"sourcesContent":["// middlewares/requestId.ts\nimport type {Request, Response, NextFunction} from \"express\";\nimport {randomUUID, randomBytes} from \"crypto\";\n\nexport const REQUEST_ID_HEADER = \"x-request-id\";\nexport const REQUEST_ID_HEADER_ALT = \"x-requestid\";\nexport const RESPONSE_REQUEST_ID_HEADER = \"X-Request-Id\";\n\n// Si quieres IDs más cortos (opcional). Por defecto usamos UUID.\nfunction nanoidLike(len = 21) {\n return randomBytes(16).toString(\"base64url\").slice(0, len);\n}\n\nexport default function requestId(req: Request, res: Response, next: NextFunction) {\n const headerId = (req.headers[REQUEST_ID_HEADER] || req.headers[REQUEST_ID_HEADER_ALT]) as\n | string\n | undefined;\n\n // ✅ estándar único: usa UUID (o cambia a nanoidLike() si prefieres corto)\n const id = headerId?.trim() || randomUUID();\n\n // ✅ estándar único (no legacy)\n (req as any).requestId = id;\n res.locals.requestId = id;\n\n // ✅ respuesta\n res.setHeader(RESPONSE_REQUEST_ID_HEADER, id);\n\n next();\n}\n","import type {Request, Response, NextFunction} from \"express\";\nimport {getRequestContextFromHeaders} from \"../headers\";\n\n/**\n * ✅ NO-LEGACY:\n * - solo setea UIDs\n * - no crea objetos company/branch\n * - no copia provider\n */\nexport default function parseHeaders(req: Request, _res: Response, next: NextFunction) {\n const context = getRequestContextFromHeaders(req.headers as any);\n\n (req as any).context = context;\n\n const auth: any = (req as any).auth ?? ((req as any).auth = {});\n if (context.company_uid) auth.company_uid = context.company_uid;\n if (context.branch_uid) auth.branch_uid = context.branch_uid;\n if (context.employee_uid) auth.employee_uid = context.employee_uid;\n\n next();\n}\n","import type {Request, Response, NextFunction} from \"express\";\nimport fs from \"fs\";\nimport crypto from \"crypto\";\nimport {sendError} from \"./respond\";\nimport {HEADER_INTERNAL_API_KEY} from \"../headers\";\n\nfunction readSecretFile(path?: string): string | null {\n if (!path) return null;\n try {\n const v = fs.readFileSync(path, \"utf8\").trim();\n return v.length ? v : null;\n } catch {\n return null;\n }\n}\n\nfunction splitKeys(v?: string | null): string[] {\n if (!v) return [];\n return v.split(\",\").map((s) => s.trim()).filter(Boolean);\n}\n\nfunction getExpectedKeys(): string[] {\n const fileKey = readSecretFile(process.env.INTERNAL_API_KEY_FILE);\n const envKey = (process.env.INTERNAL_API_KEY || \"\").trim();\n const raw = fileKey || envKey;\n return splitKeys(raw);\n}\n\nfunction extractToken(req: Request): string | null {\n const apiKey = (req.header(HEADER_INTERNAL_API_KEY) || \"\").trim();\n return apiKey || null;\n}\n\nfunction safeEquals(a: string, b: string): boolean {\n const aa = Buffer.from(a);\n const bb = Buffer.from(b);\n if (aa.length !== bb.length) return false;\n return crypto.timingSafeEqual(aa, bb);\n}\n\nexport default function internalAuth(req: Request, res: Response, next: NextFunction) {\n const token = extractToken(req);\n\n if (!token) {\n return sendError(req, res, 401, \"UNAUTHORIZED\", `Missing internal api key (${HEADER_INTERNAL_API_KEY})`);\n }\n\n const expectedKeys = getExpectedKeys();\n if (expectedKeys.length === 0) {\n return sendError(\n req,\n res,\n 500,\n \"MISCONFIGURED_INTERNAL_AUTH\",\n \"Internal api key not configured (INTERNAL_API_KEY or INTERNAL_API_KEY_FILE)\"\n );\n }\n\n const ok = expectedKeys.some((k) => safeEquals(token, k));\n if (!ok) {\n return sendError(req, res, 403, \"FORBIDDEN\", \"Invalid internal api key\");\n }\n\n return next();\n}\n","import type {Request, Response} from \"express\";\n\nexport function sendOk<T>(_req: Request, res: Response, data: T, statusCode = 200) {\n return res.status(statusCode).json({ok: true, data, requestId: res.locals?.requestId ?? null});\n}\n\nexport function sendError(\n _req: Request,\n res: Response,\n statusCode: number,\n code: string,\n message: string,\n details?: any\n) {\n return res.status(statusCode).json({\n ok: false,\n error: {code, message, ...(details !== undefined ? {details} : {})},\n requestId: res.locals?.requestId ?? null,\n });\n}\n","// packages/sdk/src/middlewares/authorization.ts\nimport type {Request, Response, NextFunction} from \"express\";\nimport {sendError} from \"./respond\";\n\ntype AuthShape = {\n roles?: string[];\n permissions?: string[];\n denied_permissions?: string[];\n};\n\nfunction getAuth(req: Request): AuthShape {\n return ((req as any).auth ?? {}) as AuthShape;\n}\n\n/**\n * 401 si no existe req.auth (contexto auth).\n * Útil para proteger rutas internas donde SIEMPRE debe existir auth.\n */\nexport function requireAuthContext() {\n return (req: Request, res: Response, next: NextFunction) => {\n if (!(req as any).auth) {\n return sendError(req, res, 401, \"UNAUTHORIZED\", \"Missing auth context\");\n }\n return next();\n };\n}\n\n/**\n * Requiere TODOS los permisos indicados.\n * Regla: denied_permissions siempre gana sobre permissions.\n */\nexport function requirePermissions(...perms: string[]) {\n return (req: Request, res: Response, next: NextFunction) => {\n const auth = getAuth(req);\n\n const allow = new Set<string>(auth.permissions ?? []);\n const deny = new Set<string>(auth.denied_permissions ?? []);\n\n // deny gana siempre\n for (const p of perms) {\n if (deny.has(p)) {\n return sendError(req, res, 403, \"FORBIDDEN\", `Denied: ${p}`);\n }\n }\n\n const missing = perms.filter((p) => !allow.has(p));\n if (missing.length) {\n return sendError(req, res, 403, \"FORBIDDEN\", \"Missing permissions\", {missing});\n }\n\n return next();\n };\n}\n\n/**\n * Requiere al menos 1 de los roles indicados.\n */\nexport function requireRoles(...roles: string[]) {\n return (req: Request, res: Response, next: NextFunction) => {\n const auth = getAuth(req);\n const have = new Set<string>(auth.roles ?? []);\n\n if (!roles.some((r) => have.has(r))) {\n return sendError(req, res, 403, \"FORBIDDEN\", \"Role not allowed\", {required: roles});\n }\n\n return next();\n };\n}\n"],"mappings":";;;;;;AAEA,SAAQ,YAAY,mBAAkB;AAE/B,IAAM,oBAAoB;AAC1B,IAAM,wBAAwB;AAC9B,IAAM,6BAA6B;AAO3B,SAAR,UAA2B,KAAc,KAAe,MAAoB;AAC/E,QAAM,WAAY,IAAI,QAAQ,iBAAiB,KAAK,IAAI,QAAQ,qBAAqB;AAKrF,QAAM,KAAK,UAAU,KAAK,KAAK,WAAW;AAG1C,EAAC,IAAY,YAAY;AACzB,MAAI,OAAO,YAAY;AAGvB,MAAI,UAAU,4BAA4B,EAAE;AAE5C,OAAK;AACT;;;ACpBe,SAAR,aAA8B,KAAc,MAAgB,MAAoB;AACnF,QAAM,UAAU,6BAA6B,IAAI,OAAc;AAE/D,EAAC,IAAY,UAAU;AAEvB,QAAM,OAAa,IAAY,SAAU,IAAY,OAAO,CAAC;AAC7D,MAAI,QAAQ,YAAa,MAAK,cAAc,QAAQ;AACpD,MAAI,QAAQ,WAAY,MAAK,aAAa,QAAQ;AAClD,MAAI,QAAQ,aAAc,MAAK,eAAe,QAAQ;AAEtD,OAAK;AACT;;;ACnBA,OAAO,QAAQ;AACf,OAAO,YAAY;;;ACAZ,SAAS,OAAU,MAAe,KAAe,MAAS,aAAa,KAAK;AAC/E,SAAO,IAAI,OAAO,UAAU,EAAE,KAAK,EAAC,IAAI,MAAM,MAAM,WAAW,IAAI,QAAQ,aAAa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,SAAO,CAAC,KAAc,KAAe,SAAuB;AACxD,UAAM,OAAO,QAAQ,GAAG;AACxB,UAAM,OAAO,IAAI,IAAY,KAAK,SAAS,CAAC,CAAC;AAE7C,QAAI,CAAC,MAAM,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,GAAG;AACjC,aAAO,UAAU,KAAK,KAAK,KAAK,aAAa,oBAAoB,EAAC,UAAU,MAAK,CAAC;AAAA,IACtF;AAEA,WAAO,KAAK;AAAA,EAChB;AACJ;","names":[]}
@@ -1,87 +0,0 @@
1
- import { Request, Response, NextFunction } from 'express';
2
- import { JwtPayload } from 'jsonwebtoken';
3
-
4
- type AuthSubject = "employee" | "customer";
5
- type TokenType = "backend";
6
- type AuthSession = {
7
- jti?: string;
8
- device_id?: string;
9
- expires_at?: number;
10
- };
11
- type AuthContext = {
12
- tokenType: TokenType;
13
- subject: AuthSubject;
14
- employee?: any;
15
- customer?: any;
16
- company_uid?: string;
17
- branch_uid?: string;
18
- companies?: any[];
19
- company?: any;
20
- branch?: any;
21
- roles?: string[];
22
- permissions?: string[];
23
- denied_permissions?: string[];
24
- session?: AuthSession;
25
- firebase?: any;
26
- };
27
- type HydrateInput = {
28
- decoded: any;
29
- req: Request;
30
- subject: AuthSubject;
31
- company_uid: string | null;
32
- branch_uid: string | null;
33
- };
34
- type HydrateResult = Partial<Pick<AuthContext, "employee" | "customer" | "companies" | "company" | "branch" | "roles" | "permissions" | "denied_permissions">>;
35
- type Hydrator = (input: HydrateInput) => Promise<HydrateResult> | HydrateResult;
36
- type AuthMiddlewareOptions = {
37
- subject: AuthSubject;
38
- /**
39
- * ✅ Si true, exige que el sujeto (employee/customer) exista tras hydrate.
40
- * Default: true
41
- */
42
- requireSubject?: boolean;
43
- /**
44
- * Si true, permite fallback a Firebase idToken.
45
- * Default: false
46
- */
47
- allowFirebaseIdToken?: boolean;
48
- /**
49
- * ✅ OBLIGATORIO para evitar "legacy" o acoplamientos:
50
- * el micro decide cómo hidratar (DB local / AuthClient / etc).
51
- */
52
- hydrate: Hydrator;
53
- };
54
-
55
- /**
56
- * ✅ Keys viven en getmarket-stack:
57
- * - JWT_PUBLIC_KEY_PATH=/run/secrets/jwtRS256.key.pub (recomendado)
58
- * - fallback env AUTH_JWT_PUBLIC_KEY / AUTH_RSA_PUBLIC_KEY
59
- */
60
- declare function readRs256PublicKey(): string;
61
- declare function verifyBackendJwtRS256(raw: string): JwtPayload;
62
-
63
- /**
64
- * ✅ Middleware estándar:
65
- * - Solo Authorization: Bearer
66
- * - Solo RS256
67
- * - Cero legacy
68
- * - Hidrata vía hook (OBLIGATORIO) para que cada micro no replique lógica
69
- */
70
- declare function createAuthMiddleware(opts: AuthMiddlewareOptions): (req: any, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>;
71
-
72
- type index_AuthContext = AuthContext;
73
- type index_AuthMiddlewareOptions = AuthMiddlewareOptions;
74
- type index_AuthSession = AuthSession;
75
- type index_AuthSubject = AuthSubject;
76
- type index_HydrateInput = HydrateInput;
77
- type index_HydrateResult = HydrateResult;
78
- type index_Hydrator = Hydrator;
79
- type index_TokenType = TokenType;
80
- declare const index_createAuthMiddleware: typeof createAuthMiddleware;
81
- declare const index_readRs256PublicKey: typeof readRs256PublicKey;
82
- declare const index_verifyBackendJwtRS256: typeof verifyBackendJwtRS256;
83
- declare namespace index {
84
- export { type index_AuthContext as AuthContext, type index_AuthMiddlewareOptions as AuthMiddlewareOptions, type index_AuthSession as AuthSession, type index_AuthSubject as AuthSubject, type index_HydrateInput as HydrateInput, type index_HydrateResult as HydrateResult, type index_Hydrator as Hydrator, type index_TokenType as TokenType, index_createAuthMiddleware as createAuthMiddleware, index_readRs256PublicKey as readRs256PublicKey, index_verifyBackendJwtRS256 as verifyBackendJwtRS256 };
85
- }
86
-
87
- export { type AuthContext as A, type HydrateInput as H, type TokenType as T, type AuthMiddlewareOptions as a, type AuthSession as b, type AuthSubject as c, type HydrateResult as d, type Hydrator as e, createAuthMiddleware as f, index as i, readRs256PublicKey as r, verifyBackendJwtRS256 as v };
@@ -1,87 +0,0 @@
1
- import { Request, Response, NextFunction } from 'express';
2
- import { JwtPayload } from 'jsonwebtoken';
3
-
4
- type AuthSubject = "employee" | "customer";
5
- type TokenType = "backend";
6
- type AuthSession = {
7
- jti?: string;
8
- device_id?: string;
9
- expires_at?: number;
10
- };
11
- type AuthContext = {
12
- tokenType: TokenType;
13
- subject: AuthSubject;
14
- employee?: any;
15
- customer?: any;
16
- company_uid?: string;
17
- branch_uid?: string;
18
- companies?: any[];
19
- company?: any;
20
- branch?: any;
21
- roles?: string[];
22
- permissions?: string[];
23
- denied_permissions?: string[];
24
- session?: AuthSession;
25
- firebase?: any;
26
- };
27
- type HydrateInput = {
28
- decoded: any;
29
- req: Request;
30
- subject: AuthSubject;
31
- company_uid: string | null;
32
- branch_uid: string | null;
33
- };
34
- type HydrateResult = Partial<Pick<AuthContext, "employee" | "customer" | "companies" | "company" | "branch" | "roles" | "permissions" | "denied_permissions">>;
35
- type Hydrator = (input: HydrateInput) => Promise<HydrateResult> | HydrateResult;
36
- type AuthMiddlewareOptions = {
37
- subject: AuthSubject;
38
- /**
39
- * ✅ Si true, exige que el sujeto (employee/customer) exista tras hydrate.
40
- * Default: true
41
- */
42
- requireSubject?: boolean;
43
- /**
44
- * Si true, permite fallback a Firebase idToken.
45
- * Default: false
46
- */
47
- allowFirebaseIdToken?: boolean;
48
- /**
49
- * ✅ OBLIGATORIO para evitar "legacy" o acoplamientos:
50
- * el micro decide cómo hidratar (DB local / AuthClient / etc).
51
- */
52
- hydrate: Hydrator;
53
- };
54
-
55
- /**
56
- * ✅ Keys viven en getmarket-stack:
57
- * - JWT_PUBLIC_KEY_PATH=/run/secrets/jwtRS256.key.pub (recomendado)
58
- * - fallback env AUTH_JWT_PUBLIC_KEY / AUTH_RSA_PUBLIC_KEY
59
- */
60
- declare function readRs256PublicKey(): string;
61
- declare function verifyBackendJwtRS256(raw: string): JwtPayload;
62
-
63
- /**
64
- * ✅ Middleware estándar:
65
- * - Solo Authorization: Bearer
66
- * - Solo RS256
67
- * - Cero legacy
68
- * - Hidrata vía hook (OBLIGATORIO) para que cada micro no replique lógica
69
- */
70
- declare function createAuthMiddleware(opts: AuthMiddlewareOptions): (req: any, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>;
71
-
72
- type index_AuthContext = AuthContext;
73
- type index_AuthMiddlewareOptions = AuthMiddlewareOptions;
74
- type index_AuthSession = AuthSession;
75
- type index_AuthSubject = AuthSubject;
76
- type index_HydrateInput = HydrateInput;
77
- type index_HydrateResult = HydrateResult;
78
- type index_Hydrator = Hydrator;
79
- type index_TokenType = TokenType;
80
- declare const index_createAuthMiddleware: typeof createAuthMiddleware;
81
- declare const index_readRs256PublicKey: typeof readRs256PublicKey;
82
- declare const index_verifyBackendJwtRS256: typeof verifyBackendJwtRS256;
83
- declare namespace index {
84
- export { type index_AuthContext as AuthContext, type index_AuthMiddlewareOptions as AuthMiddlewareOptions, type index_AuthSession as AuthSession, type index_AuthSubject as AuthSubject, type index_HydrateInput as HydrateInput, type index_HydrateResult as HydrateResult, type index_Hydrator as Hydrator, type index_TokenType as TokenType, index_createAuthMiddleware as createAuthMiddleware, index_readRs256PublicKey as readRs256PublicKey, index_verifyBackendJwtRS256 as verifyBackendJwtRS256 };
85
- }
86
-
87
- export { type AuthContext as A, type HydrateInput as H, type TokenType as T, type AuthMiddlewareOptions as a, type AuthSession as b, type AuthSubject as c, type HydrateResult as d, type Hydrator as e, createAuthMiddleware as f, index as i, readRs256PublicKey as r, verifyBackendJwtRS256 as v };
File without changes