@pablo2410/core-server 0.4.2 → 0.4.3

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.
@@ -11,8 +11,12 @@ function createHierarchyService(config) {
11
11
  } = config;
12
12
  const configured = Boolean(portalApiUrl && portalApiKey);
13
13
  let cache = null;
14
+ let lastError = null;
14
15
  async function fetchRaw() {
15
- if (!configured) return null;
16
+ if (!configured) {
17
+ lastError = "not configured (PORTAL_API_URL/PORTAL_API_KEY missing)";
18
+ return null;
19
+ }
16
20
  const url = `${portalApiUrl.replace(/\/$/, "")}/api/service/hierarchy`;
17
21
  let res;
18
22
  try {
@@ -22,12 +26,24 @@ function createHierarchyService(config) {
22
26
  "Content-Type": "application/json"
23
27
  }
24
28
  });
25
- } catch {
29
+ } catch (err) {
30
+ lastError = `fetch threw: ${err instanceof Error ? err.message : String(err)}`;
31
+ console.error(`[HierarchyService] ${lastError} (url=${url})`);
32
+ return null;
33
+ }
34
+ if (!res.ok) {
35
+ lastError = `HTTP ${res.status} ${res.statusText} from ${url}`;
36
+ console.error(`[HierarchyService] ${lastError}`);
26
37
  return null;
27
38
  }
28
- if (!res.ok) return null;
29
39
  const json = await res.json().catch(() => null);
30
- return json ? normalize(json) : null;
40
+ if (!json) {
41
+ lastError = `invalid/empty JSON body from ${url}`;
42
+ console.error(`[HierarchyService] ${lastError}`);
43
+ return null;
44
+ }
45
+ lastError = null;
46
+ return normalize(json);
31
47
  }
32
48
  async function getFullHierarchy() {
33
49
  if (cacheTtlMs > 0 && cache && now() - cache.at < cacheTtlMs) {
@@ -48,7 +64,8 @@ function createHierarchyService(config) {
48
64
  return {
49
65
  configured,
50
66
  cached: cache !== null,
51
- ageMs: cache ? now() - cache.at : null
67
+ ageMs: cache ? now() - cache.at : null,
68
+ lastError
52
69
  };
53
70
  }
54
71
  return { getScopedHierarchy, getFullHierarchy, invalidate, getStatus };
@@ -95,4 +112,4 @@ function normalize(data) {
95
112
  export {
96
113
  createHierarchyService
97
114
  };
98
- //# sourceMappingURL=chunk-5Y5LLC4Z.js.map
115
+ //# sourceMappingURL=chunk-OAF3JSO7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hierarchy.ts"],"sourcesContent":["/**\n * Hierarchy Service — the single server-side source for org-hierarchy data.\n *\n * Fetches the canonical org-hierarchy from the Portal Service API\n * (GET /api/service/hierarchy, authenticated with a platform-level service key),\n * caches it with a TTL, and scopes it to a caller's enterprise using the shared\n * isolation rule (scopeHierarchyToEnterprise from @pablo2410/shared-ui).\n *\n * One fetch, one mapper, one cache, one scope policy. Every subdomain constructs\n * this once from its env and calls getScopedHierarchy(ctx.user) in its tRPC\n * `hierarchy` procedure — no per-app fetch/scope/null-policy reinvention.\n *\n * Quick example:\n * const hierarchy = createHierarchyService({\n * portalApiUrl: process.env.PORTAL_API_URL ?? \"\",\n * portalApiKey: process.env.PORTAL_API_KEY ?? \"\",\n * });\n * // in a tRPC router:\n * hierarchy: protectedProcedure.query(({ ctx }) => hierarchy.getScopedHierarchy(ctx.user)),\n */\nimport type { OrgHierarchyData } from \"@pablo2410/shared-ui/hierarchy/core\";\nimport { scopeHierarchyToEnterprise } from \"@pablo2410/shared-ui/hierarchy/core\";\n\nexport interface HierarchyServiceConfig {\n /** Portal Service API base URL, e.g. https://portal.oplytics.digital */\n portalApiUrl: string;\n /** Platform-level X-Service-Key for the Portal Service API. */\n portalApiKey: string;\n /** Cache TTL in milliseconds. Default 15 minutes. Set 0 to disable caching. */\n cacheTtlMs?: number;\n /** Injectable fetch implementation (for tests). Defaults to global fetch. */\n fetchImpl?: typeof fetch;\n /** Injectable clock (for tests). Defaults to Date.now. */\n now?: () => number;\n}\n\nexport interface HierarchyService {\n /**\n * The org-hierarchy scoped to the caller's enterprise. A user with no resolved\n * enterprise (null/undefined enterpriseId) receives an empty hierarchy — see\n * scopeHierarchyToEnterprise for the policy. Never returns null.\n */\n getScopedHierarchy(\n user: { enterpriseId?: number | null } | null,\n ): Promise<OrgHierarchyData>;\n /**\n * The full, unscoped hierarchy (every enterprise). For Portal/admin tooling\n * only — subdomains must use getScopedHierarchy. null if unconfigured/unreachable.\n */\n getFullHierarchy(): Promise<OrgHierarchyData | null>;\n /** Clear the cache (e.g. after a portal sync). */\n invalidate(): void;\n /** Config + cache status, for health endpoints. */\n getStatus(): {\n configured: boolean;\n cached: boolean;\n ageMs: number | null;\n /** Reason the last fetch failed (null if the last fetch succeeded). */\n lastError: string | null;\n };\n}\n\nconst FIFTEEN_MINUTES = 15 * 60 * 1000;\n\nexport function createHierarchyService(\n config: HierarchyServiceConfig,\n): HierarchyService {\n const {\n portalApiUrl,\n portalApiKey,\n cacheTtlMs = FIFTEEN_MINUTES,\n fetchImpl = fetch,\n now = Date.now,\n } = config;\n\n const configured = Boolean(portalApiUrl && portalApiKey);\n let cache: { data: OrgHierarchyData; at: number } | null = null;\n // Last fetch failure reason, surfaced via getStatus() for diagnostics. A\n // configured service that returns an empty hierarchy is almost always a fetch\n // failure (wrong URL/key, unreachable Portal, non-200) — without this it was\n // swallowed to a silent null and looked like \"enterprise has no data\".\n let lastError: string | null = null;\n\n async function fetchRaw(): Promise<OrgHierarchyData | null> {\n if (!configured) {\n lastError = \"not configured (PORTAL_API_URL/PORTAL_API_KEY missing)\";\n return null;\n }\n const url = `${portalApiUrl.replace(/\\/$/, \"\")}/api/service/hierarchy`;\n let res: Response;\n try {\n res = await fetchImpl(url, {\n headers: {\n \"X-Service-Key\": portalApiKey,\n \"Content-Type\": \"application/json\",\n },\n });\n } catch (err) {\n lastError = `fetch threw: ${err instanceof Error ? err.message : String(err)}`;\n console.error(`[HierarchyService] ${lastError} (url=${url})`);\n return null;\n }\n if (!res.ok) {\n lastError = `HTTP ${res.status} ${res.statusText} from ${url}`;\n console.error(`[HierarchyService] ${lastError}`);\n return null;\n }\n const json = await res.json().catch(() => null);\n if (!json) {\n lastError = `invalid/empty JSON body from ${url}`;\n console.error(`[HierarchyService] ${lastError}`);\n return null;\n }\n lastError = null;\n return normalize(json);\n }\n\n async function getFullHierarchy(): Promise<OrgHierarchyData | null> {\n if (cacheTtlMs > 0 && cache && now() - cache.at < cacheTtlMs) {\n return cache.data;\n }\n const data = await fetchRaw();\n if (data && cacheTtlMs > 0) cache = { data, at: now() };\n return data;\n }\n\n async function getScopedHierarchy(\n user: { enterpriseId?: number | null } | null,\n ): Promise<OrgHierarchyData> {\n const full = await getFullHierarchy();\n return scopeHierarchyToEnterprise(full, user?.enterpriseId ?? null);\n }\n\n function invalidate(): void {\n cache = null;\n }\n\n function getStatus() {\n return {\n configured,\n cached: cache !== null,\n ageMs: cache ? now() - cache.at : null,\n lastError,\n };\n }\n\n return { getScopedHierarchy, getFullHierarchy, invalidate, getStatus };\n}\n\n/**\n * Map the Portal Service API response to the canonical OrgHierarchyData shape.\n * Tolerant of missing arrays (defaults to []) so a partial payload never throws.\n */\nfunction normalize(data: unknown): OrgHierarchyData {\n const d = (data ?? {}) as Record<string, any[]>;\n return {\n enterprises: (d.enterprises ?? []).map((e) => ({\n id: e.id,\n name: e.name,\n code: e.code,\n })),\n businessUnits: (d.businessUnits ?? []).map((bu) => ({\n id: bu.id,\n name: bu.name,\n code: bu.code,\n enterpriseId: bu.enterpriseId,\n })),\n sites: (d.sites ?? []).map((s) => ({\n id: s.id,\n name: s.name,\n code: s.code,\n enterpriseId: s.enterpriseId,\n businessUnitId: s.businessUnitId ?? 0,\n location: s.location,\n })),\n areas: (d.areas ?? []).map((a) => ({\n id: a.id,\n name: a.name,\n code: a.code,\n siteId: a.siteId,\n })),\n assets: (d.assets ?? []).map((a) => ({\n id: a.id,\n name: a.name,\n code: a.code,\n siteId: a.siteId,\n areaId: a.areaId ?? 0,\n assetType: a.assetType,\n })),\n };\n}\n"],"mappings":";AAqBA,SAAS,kCAAkC;AAyC3C,IAAM,kBAAkB,KAAK,KAAK;AAE3B,SAAS,uBACd,QACkB;AAClB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IAC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AAE;AAAA,MACR,QAAQ,EAAE;AAAA,MACV,QAAQ,EAAE,UAAU;AAAA,MACpB,WAAW,EAAE;AAAA,IACf,EAAE;AAAA,EACJ;AACF;","names":[]}
@@ -54,6 +54,8 @@ interface HierarchyService {
54
54
  configured: boolean;
55
55
  cached: boolean;
56
56
  ageMs: number | null;
57
+ /** Reason the last fetch failed (null if the last fetch succeeded). */
58
+ lastError: string | null;
57
59
  };
58
60
  }
59
61
  declare function createHierarchyService(config: HierarchyServiceConfig): HierarchyService;
package/dist/hierarchy.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createHierarchyService
3
- } from "./chunk-5Y5LLC4Z.js";
3
+ } from "./chunk-OAF3JSO7.js";
4
4
  export {
5
5
  createHierarchyService
6
6
  };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-23I5TW53.js";
4
4
  import {
5
5
  createHierarchyService
6
- } from "./chunk-5Y5LLC4Z.js";
6
+ } from "./chunk-OAF3JSO7.js";
7
7
 
8
8
  // src/constants/sqdcp.ts
9
9
  var SQDCP_PILLARS = ["safety", "quality", "delivery", "cost", "people"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pablo2410/core-server",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Shared server utilities for Oplytics.digital subdomains",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hierarchy.ts"],"sourcesContent":["/**\n * Hierarchy Service — the single server-side source for org-hierarchy data.\n *\n * Fetches the canonical org-hierarchy from the Portal Service API\n * (GET /api/service/hierarchy, authenticated with a platform-level service key),\n * caches it with a TTL, and scopes it to a caller's enterprise using the shared\n * isolation rule (scopeHierarchyToEnterprise from @pablo2410/shared-ui).\n *\n * One fetch, one mapper, one cache, one scope policy. Every subdomain constructs\n * this once from its env and calls getScopedHierarchy(ctx.user) in its tRPC\n * `hierarchy` procedure — no per-app fetch/scope/null-policy reinvention.\n *\n * Quick example:\n * const hierarchy = createHierarchyService({\n * portalApiUrl: process.env.PORTAL_API_URL ?? \"\",\n * portalApiKey: process.env.PORTAL_API_KEY ?? \"\",\n * });\n * // in a tRPC router:\n * hierarchy: protectedProcedure.query(({ ctx }) => hierarchy.getScopedHierarchy(ctx.user)),\n */\nimport type { OrgHierarchyData } from \"@pablo2410/shared-ui/hierarchy/core\";\nimport { scopeHierarchyToEnterprise } from \"@pablo2410/shared-ui/hierarchy/core\";\n\nexport interface HierarchyServiceConfig {\n /** Portal Service API base URL, e.g. https://portal.oplytics.digital */\n portalApiUrl: string;\n /** Platform-level X-Service-Key for the Portal Service API. */\n portalApiKey: string;\n /** Cache TTL in milliseconds. Default 15 minutes. Set 0 to disable caching. */\n cacheTtlMs?: number;\n /** Injectable fetch implementation (for tests). Defaults to global fetch. */\n fetchImpl?: typeof fetch;\n /** Injectable clock (for tests). Defaults to Date.now. */\n now?: () => number;\n}\n\nexport interface HierarchyService {\n /**\n * The org-hierarchy scoped to the caller's enterprise. A user with no resolved\n * enterprise (null/undefined enterpriseId) receives an empty hierarchy — see\n * scopeHierarchyToEnterprise for the policy. Never returns null.\n */\n getScopedHierarchy(\n user: { enterpriseId?: number | null } | null,\n ): Promise<OrgHierarchyData>;\n /**\n * The full, unscoped hierarchy (every enterprise). For Portal/admin tooling\n * only — subdomains must use getScopedHierarchy. null if unconfigured/unreachable.\n */\n getFullHierarchy(): Promise<OrgHierarchyData | null>;\n /** Clear the cache (e.g. after a portal sync). */\n invalidate(): void;\n /** Config + cache status, for health endpoints. */\n getStatus(): { configured: boolean; cached: boolean; ageMs: number | null };\n}\n\nconst FIFTEEN_MINUTES = 15 * 60 * 1000;\n\nexport function createHierarchyService(\n config: HierarchyServiceConfig,\n): HierarchyService {\n const {\n portalApiUrl,\n portalApiKey,\n cacheTtlMs = FIFTEEN_MINUTES,\n fetchImpl = fetch,\n now = Date.now,\n } = config;\n\n const configured = Boolean(portalApiUrl && portalApiKey);\n let cache: { data: OrgHierarchyData; at: number } | null = null;\n\n async function fetchRaw(): Promise<OrgHierarchyData | null> {\n if (!configured) return null;\n const url = `${portalApiUrl.replace(/\\/$/, \"\")}/api/service/hierarchy`;\n let res: Response;\n try {\n res = await fetchImpl(url, {\n headers: {\n \"X-Service-Key\": portalApiKey,\n \"Content-Type\": \"application/json\",\n },\n });\n } catch {\n return null;\n }\n if (!res.ok) return null;\n const json = await res.json().catch(() => null);\n return json ? normalize(json) : null;\n }\n\n async function getFullHierarchy(): Promise<OrgHierarchyData | null> {\n if (cacheTtlMs > 0 && cache && now() - cache.at < cacheTtlMs) {\n return cache.data;\n }\n const data = await fetchRaw();\n if (data && cacheTtlMs > 0) cache = { data, at: now() };\n return data;\n }\n\n async function getScopedHierarchy(\n user: { enterpriseId?: number | null } | null,\n ): Promise<OrgHierarchyData> {\n const full = await getFullHierarchy();\n return scopeHierarchyToEnterprise(full, user?.enterpriseId ?? null);\n }\n\n function invalidate(): void {\n cache = null;\n }\n\n function getStatus() {\n return {\n configured,\n cached: cache !== null,\n ageMs: cache ? now() - cache.at : null,\n };\n }\n\n return { getScopedHierarchy, getFullHierarchy, invalidate, getStatus };\n}\n\n/**\n * Map the Portal Service API response to the canonical OrgHierarchyData shape.\n * Tolerant of missing arrays (defaults to []) so a partial payload never throws.\n */\nfunction normalize(data: unknown): OrgHierarchyData {\n const d = (data ?? {}) as Record<string, any[]>;\n return {\n enterprises: (d.enterprises ?? []).map((e) => ({\n id: e.id,\n name: e.name,\n code: e.code,\n })),\n businessUnits: (d.businessUnits ?? []).map((bu) => ({\n id: bu.id,\n name: bu.name,\n code: bu.code,\n enterpriseId: bu.enterpriseId,\n })),\n sites: (d.sites ?? []).map((s) => ({\n id: s.id,\n name: s.name,\n code: s.code,\n enterpriseId: s.enterpriseId,\n businessUnitId: s.businessUnitId ?? 0,\n location: s.location,\n })),\n areas: (d.areas ?? []).map((a) => ({\n id: a.id,\n name: a.name,\n code: a.code,\n siteId: a.siteId,\n })),\n assets: (d.assets ?? []).map((a) => ({\n id: a.id,\n name: a.name,\n code: a.code,\n siteId: a.siteId,\n areaId: a.areaId ?? 0,\n assetType: a.assetType,\n })),\n };\n}\n"],"mappings":";AAqBA,SAAS,kCAAkC;AAmC3C,IAAM,kBAAkB,KAAK,KAAK;AAE3B,SAAS,uBACd,QACkB;AAClB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,MAAM,KAAK;AAAA,EACb,IAAI;AAEJ,QAAM,aAAa,QAAQ,gBAAgB,YAAY;AACvD,MAAI,QAAuD;AAE3D,iBAAe,WAA6C;AAC1D,QAAI,CAAC,WAAY,QAAO;AACxB,UAAM,MAAM,GAAG,aAAa,QAAQ,OAAO,EAAE,CAAC;AAC9C,QAAI;AACJ,QAAI;AACF,YAAM,MAAM,UAAU,KAAK;AAAA,QACzB,SAAS;AAAA,UACP,iBAAiB;AAAA,UACjB,gBAAgB;AAAA,QAClB;AAAA,MACF,CAAC;AAAA,IACH,QAAQ;AACN,aAAO;AAAA,IACT;AACA,QAAI,CAAC,IAAI,GAAI,QAAO;AACpB,UAAM,OAAO,MAAM,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI;AAC9C,WAAO,OAAO,UAAU,IAAI,IAAI;AAAA,EAClC;AAEA,iBAAe,mBAAqD;AAClE,QAAI,aAAa,KAAK,SAAS,IAAI,IAAI,MAAM,KAAK,YAAY;AAC5D,aAAO,MAAM;AAAA,IACf;AACA,UAAM,OAAO,MAAM,SAAS;AAC5B,QAAI,QAAQ,aAAa,EAAG,SAAQ,EAAE,MAAM,IAAI,IAAI,EAAE;AACtD,WAAO;AAAA,EACT;AAEA,iBAAe,mBACb,MAC2B;AAC3B,UAAM,OAAO,MAAM,iBAAiB;AACpC,WAAO,2BAA2B,MAAM,MAAM,gBAAgB,IAAI;AAAA,EACpE;AAEA,WAAS,aAAmB;AAC1B,YAAQ;AAAA,EACV;AAEA,WAAS,Y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