@entifix/next-shell 0.4.2 → 0.6.0
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/back-office/group-by-screen-type.d.ts +2 -2
- package/dist/lib/back-office/group-by-screen-type.js +2 -2
- package/dist/lib/back-office/group-by-screen-type.js.map +1 -1
- package/dist/lib/back-office/nav.d.ts +1 -2
- package/dist/lib/back-office/nav.d.ts.map +1 -1
- package/dist/lib/back-office/nav.js.map +1 -1
- package/dist/lib/back-office/sidebar-nav.d.ts +2 -2
- package/dist/lib/back-office/sidebar-nav.js +2 -2
- package/dist/lib/back-office/sidebar-nav.js.map +1 -1
- package/dist/lib/command-palette/command-palette-host.js +1 -1
- package/dist/lib/command-palette/command-palette-host.js.map +1 -1
- package/dist/lib/command-palette/use-command-recency.d.ts +1 -1
- package/dist/lib/command-palette/use-command-recency.js +1 -1
- package/dist/lib/command-palette/use-command-recency.js.map +1 -1
- package/dist/lib/command-palette/use-nav-source.d.ts +4 -3
- package/dist/lib/command-palette/use-nav-source.d.ts.map +1 -1
- package/dist/lib/command-palette/use-nav-source.js +4 -3
- package/dist/lib/command-palette/use-nav-source.js.map +1 -1
- package/dist/lib/command-palette/use-records-source.d.ts +1 -1
- package/dist/lib/command-palette/use-records-source.js +2 -2
- package/dist/lib/command-palette/use-records-source.js.map +1 -1
- package/dist/lib/command-palette/use-tabs-source.d.ts +1 -1
- package/dist/lib/command-palette/use-tabs-source.js +1 -1
- package/dist/lib/command-palette/use-tabs-source.js.map +1 -1
- package/dist/lib/command-palette/use-use-cases-source.js +2 -2
- package/dist/lib/command-palette/use-use-cases-source.js.map +1 -1
- package/dist/lib/config/config-route.d.ts +6 -19
- package/dist/lib/config/config-route.d.ts.map +1 -1
- package/dist/lib/config/config-route.js +6 -23
- package/dist/lib/config/config-route.js.map +1 -1
- package/dist/lib/config/configuration-source.d.ts +18 -0
- package/dist/lib/config/configuration-source.d.ts.map +1 -0
- package/dist/lib/config/configuration-source.js +15 -0
- package/dist/lib/config/configuration-source.js.map +1 -0
- package/dist/lib/config/service-proxy-route.d.ts +11 -2
- package/dist/lib/config/service-proxy-route.d.ts.map +1 -1
- package/dist/lib/config/service-proxy-route.js +27 -4
- package/dist/lib/config/service-proxy-route.js.map +1 -1
- package/dist/lib/crud/entity-crud-form.js +3 -3
- package/dist/lib/crud/entity-crud-form.js.map +1 -1
- package/dist/lib/crud/hand-off-write.d.ts +1 -1
- package/dist/lib/crud/hand-off-write.js +1 -1
- package/dist/lib/crud/hand-off-write.js.map +1 -1
- package/dist/lib/crud/make-entity-crud.d.ts +7 -9
- package/dist/lib/crud/make-entity-crud.d.ts.map +1 -1
- package/dist/lib/crud/make-entity-crud.js +15 -18
- package/dist/lib/crud/make-entity-crud.js.map +1 -1
- package/dist/lib/crud/make-entity-crud.types.d.ts +9 -12
- package/dist/lib/crud/make-entity-crud.types.d.ts.map +1 -1
- package/dist/lib/crud/make-entity-crud.types.js.map +1 -1
- package/dist/lib/crud/pending-notice.d.ts +2 -2
- package/dist/lib/crud/pending-notice.js +2 -2
- package/dist/lib/crud/pending-notice.js.map +1 -1
- package/dist/lib/crud/use-entity-affordances.d.ts +1 -1
- package/dist/lib/crud/use-entity-affordances.js +1 -1
- package/dist/lib/crud/use-entity-affordances.js.map +1 -1
- package/dist/lib/crud/use-entity-bulk.d.ts +2 -2
- package/dist/lib/crud/use-entity-bulk.js +2 -2
- package/dist/lib/crud/use-entity-bulk.js.map +1 -1
- package/dist/lib/health/health-routes.d.ts +3 -4
- package/dist/lib/health/health-routes.d.ts.map +1 -1
- package/dist/lib/health/health-routes.js +7 -9
- package/dist/lib/health/health-routes.js.map +1 -1
- package/dist/lib/i18n/catalog/en.d.ts.map +1 -1
- package/dist/lib/i18n/catalog/en.js +1 -264
- package/dist/lib/i18n/catalog/en.js.map +1 -1
- package/dist/lib/i18n/catalog/es.d.ts +2 -290
- package/dist/lib/i18n/catalog/es.d.ts.map +1 -1
- package/dist/lib/i18n/catalog/es.js +2 -296
- package/dist/lib/i18n/catalog/es.js.map +1 -1
- package/dist/lib/i18n/catalog/index.d.ts +0 -508
- package/dist/lib/i18n/catalog/index.d.ts.map +1 -1
- package/dist/lib/i18n/spec-catalog.js +4 -4
- package/dist/lib/i18n/spec-catalog.js.map +1 -1
- package/dist/lib/search/record-search-route.d.ts +1 -1
- package/dist/lib/search/record-search-route.js +1 -1
- package/dist/lib/search/record-search-route.js.map +1 -1
- package/dist/lib/search/record-search-source.d.ts +1 -2
- package/dist/lib/search/record-search-source.d.ts.map +1 -1
- package/dist/lib/search/record-search-source.js.map +1 -1
- package/dist/lib/search/record-search.types.d.ts +1 -1
- package/dist/lib/search/record-search.types.js +1 -1
- package/dist/lib/search/record-search.types.js.map +1 -1
- package/dist/lib/session/account-links.js +1 -1
- package/dist/lib/session/account-links.js.map +1 -1
- package/dist/lib/session/session-keepalive.d.ts +2 -4
- package/dist/lib/session/session-keepalive.d.ts.map +1 -1
- package/dist/lib/session/session-keepalive.js +2 -4
- package/dist/lib/session/session-keepalive.js.map +1 -1
- package/dist/lib/session/use-session-refresh.js +1 -1
- package/dist/lib/session/use-session-refresh.js.map +1 -1
- package/dist/lib/wizard/wizard-tab-kind.d.ts +1 -2
- package/dist/lib/wizard/wizard-tab-kind.d.ts.map +1 -1
- package/dist/lib/wizard/wizard-tab-kind.js +1 -2
- package/dist/lib/wizard/wizard-tab-kind.js.map +1 -1
- package/dist/lib/workspace/drafts-state.d.ts.map +1 -1
- package/dist/lib/workspace/drafts-state.js +3 -2
- package/dist/lib/workspace/drafts-state.js.map +1 -1
- package/dist/lib/workspace/entity-tab-kind.d.ts +1 -2
- package/dist/lib/workspace/entity-tab-kind.d.ts.map +1 -1
- package/dist/lib/workspace/entity-tab-kind.js +1 -2
- package/dist/lib/workspace/entity-tab-kind.js.map +1 -1
- package/dist/lib/workspace/pending-state.d.ts +5 -4
- package/dist/lib/workspace/pending-state.d.ts.map +1 -1
- package/dist/lib/workspace/pending-state.js +1 -1
- package/dist/lib/workspace/pending-state.js.map +1 -1
- package/dist/lib/workspace/tabs-state.js +1 -1
- package/dist/lib/workspace/tabs-state.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/package.json +9 -9
- package/dist/lib/config/service-token.d.ts +0 -5
- package/dist/lib/config/service-token.d.ts.map +0 -1
- package/dist/lib/config/service-token.js +0 -18
- package/dist/lib/config/service-token.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/workspace/tabs-state.ts"],"sourcesContent":["'use client';\n\nimport { create } from 'zustand';\nimport { createJSONStorage, persist } from 'zustand/middleware';\n\nimport { makeIndexedDbStateStorage } from './idb-state-storage.js';\nimport {\n closeTab,\n emptyTabs,\n openOrFocus,\n setActive,\n type TabRecord,\n type TabsSnapshot,\n} from './tab-state.js';\n\nexport interface TabsState extends TabsSnapshot {\n open(tab: TabRecord): void;\n close(param: string): void;\n activate(param: string): void;\n}\n\n/** Only the data is persisted — the action functions are re-created on load. */\nexport function persistedTabs(store: TabsState): TabsSnapshot {\n return { tabs: store.tabs, activeParam: store.activeParam };\n}\n\nexport const WORKSPACE_DB = 'entifix-workspace';\nconst WORKSPACE_STORE = 'stores';\n\n/**\n * Bump when {@link TabsSnapshot}'s shape changes, and every persisted tab set is\n * discarded on the next load.\n *\n * Restoring a snapshot this build cannot read is worse than opening empty: a tab\n * whose `param` no longer resolves renders the workspace's dead-link fallback,\n * so a drifted snapshot is a strip of broken tabs rather than an error anyone\n * can act on.\n */\n// 2: the tab address became `<screenType>:<key>[:<id>]
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/workspace/tabs-state.ts"],"sourcesContent":["'use client';\n\nimport { create } from 'zustand';\nimport { createJSONStorage, persist } from 'zustand/middleware';\n\nimport { makeIndexedDbStateStorage } from './idb-state-storage.js';\nimport {\n closeTab,\n emptyTabs,\n openOrFocus,\n setActive,\n type TabRecord,\n type TabsSnapshot,\n} from './tab-state.js';\n\nexport interface TabsState extends TabsSnapshot {\n open(tab: TabRecord): void;\n close(param: string): void;\n activate(param: string): void;\n}\n\n/** Only the data is persisted — the action functions are re-created on load. */\nexport function persistedTabs(store: TabsState): TabsSnapshot {\n return { tabs: store.tabs, activeParam: store.activeParam };\n}\n\nexport const WORKSPACE_DB = 'entifix-workspace';\nconst WORKSPACE_STORE = 'stores';\n\n/**\n * Bump when {@link TabsSnapshot}'s shape changes, and every persisted tab set is\n * discarded on the next load.\n *\n * Restoring a snapshot this build cannot read is worse than opening empty: a tab\n * whose `param` no longer resolves renders the workspace's dead-link fallback,\n * so a drifted snapshot is a strip of broken tabs rather than an error anyone\n * can act on.\n */\n// 2: the tab address became `<screenType>:<key>[:<id>]`, so every\n// `catalog:` / `entity:` / `system:` param a previous build persisted addresses\n// a kind that no longer exists.\nexport const TABS_VERSION = 2;\n\n/**\n * Discard, never guess — see {@link migrateDrafts} for the same decision on the\n * other store, and for why this is written out instead of left to zustand's\n * default (which discards too, but logs an error while doing it).\n */\nexport function migrateTabs(): TabsSnapshot {\n return emptyTabs;\n}\n\n/**\n * The open tab set, persisted to IndexedDB so a refresh restores the workspace.\n * Hydration is skipped on creation (it would touch IndexedDB during SSR) and\n * triggered from the client by `WorkspaceShell`, which also holds every URL\n * effect back until the read has landed — otherwise the restored `activeParam`\n * overwrites a `?tab=` deep link.\n */\nexport const useTabsState = create<TabsState>()(\n persist(\n set => ({\n ...emptyTabs,\n open: tab => set(state => openOrFocus(state, tab)),\n close: param => set(state => closeTab(state, param)),\n activate: param => set(state => setActive(state, param)),\n }),\n {\n // Replaced with a scoped name by `WorkspaceShell` before it rehydrates —\n // see `workspace-scope.ts`. Nothing rehydrates without passing through\n // that call, so this literal is only what an unscoped store would write.\n name: 'tabs',\n version: TABS_VERSION,\n migrate: migrateTabs,\n storage: createJSONStorage(() =>\n makeIndexedDbStateStorage(WORKSPACE_DB, WORKSPACE_STORE),\n ),\n partialize: persistedTabs,\n skipHydration: true,\n },\n ),\n);\n"],"names":["create","createJSONStorage","persist","makeIndexedDbStateStorage","closeTab","emptyTabs","openOrFocus","setActive","persistedTabs","store","tabs","activeParam","WORKSPACE_DB","WORKSPACE_STORE","TABS_VERSION","migrateTabs","useTabsState","set","open","tab","state","close","param","activate","name","version","migrate","storage","partialize","skipHydration"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,UAAU;AACjC,SAASC,iBAAiB,EAAEC,OAAO,QAAQ,qBAAqB;AAEhE,SAASC,yBAAyB,QAAQ,yBAAyB;AACnE,SACEC,QAAQ,EACRC,SAAS,EACTC,WAAW,EACXC,SAAS,QAGJ,iBAAiB;AAQxB,8EAA8E,GAC9E,OAAO,SAASC,cAAcC,KAAgB;IAC5C,OAAO;QAAEC,MAAMD,MAAMC,IAAI;QAAEC,aAAaF,MAAME,WAAW;IAAC;AAC5D;AAEA,OAAO,MAAMC,eAAe,oBAAoB;AAChD,MAAMC,kBAAkB;AAExB;;;;;;;;CAQC,GACD,kEAAkE;AAClE,gFAAgF;AAChF,gCAAgC;AAChC,OAAO,MAAMC,eAAe,EAAE;AAE9B;;;;CAIC,GACD,OAAO,SAASC;IACd,OAAOV;AACT;AAEA;;;;;;CAMC,GACD,OAAO,MAAMW,eAAehB,SAC1BE,QACEe,CAAAA,MAAQ,aACHZ;QACHa,MAAMC,CAAAA,MAAOF,IAAIG,CAAAA,QAASd,YAAYc,OAAOD;QAC7CE,OAAOC,CAAAA,QAASL,IAAIG,CAAAA,QAAShB,SAASgB,OAAOE;QAC7CC,UAAUD,CAAAA,QAASL,IAAIG,CAAAA,QAASb,UAAUa,OAAOE;QAEnD;IACE,yEAAyE;IACzE,uEAAuE;IACvE,yEAAyE;IACzEE,MAAM;IACNC,SAASX;IACTY,SAASX;IACTY,SAAS1B,kBAAkB,IACzBE,0BAA0BS,cAAcC;IAE1Ce,YAAYpB;IACZqB,eAAe;AACjB,IAEF"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './lib/health/health-routes.js';
|
|
2
2
|
export * from './lib/config/config-route.js';
|
|
3
|
-
export * from './lib/config/
|
|
3
|
+
export * from './lib/config/configuration-source.js';
|
|
4
4
|
export * from './lib/config/service-proxy-route.js';
|
|
5
5
|
export * from './lib/session/cookies.js';
|
|
6
6
|
export * from './lib/session/refresh-route.js';
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAWA,cAAc,+BAA+B,CAAC;AAG9C,cAAc,8BAA8B,CAAC;AAM7C,cAAc
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAWA,cAAc,+BAA+B,CAAC;AAG9C,cAAc,8BAA8B,CAAC;AAM7C,cAAc,sCAAsC,CAAC;AAGrD,cAAc,qCAAqC,CAAC;AAGpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAK/C,cAAc,oBAAoB,CAAC;AAInC,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AAKrD,cAAc,yBAAyB,CAAC;AAIxC,cAAc,gCAAgC,CAAC;AAG/C,cAAc,yBAAyB,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -14,7 +14,7 @@ export * from './lib/config/config-route.js';
|
|
|
14
14
|
// because a server component that reads config-service directly — rather than
|
|
15
15
|
// through its own app's `/api/config` route — has to carry it itself. It never
|
|
16
16
|
// reaches the browser: this is the server entry.
|
|
17
|
-
export * from './lib/config/
|
|
17
|
+
export * from './lib/config/configuration-source.js';
|
|
18
18
|
// The same-origin proxy each host mounts per backend it talks to.
|
|
19
19
|
export * from './lib/config/service-proxy-route.js';
|
|
20
20
|
// Session cookies + the shared refresh route handler
|
|
@@ -25,7 +25,7 @@ export * from './lib/session/refresh-route.js';
|
|
|
25
25
|
// a shell's palette commands compose the create route with it on the server.
|
|
26
26
|
export * from './lib/crud/slug.js';
|
|
27
27
|
// The cross-domain record search: the aggregating route, and the declarations a
|
|
28
|
-
// host fans out over
|
|
28
|
+
// host fans out over.
|
|
29
29
|
export * from './lib/search/record-search-route.js';
|
|
30
30
|
export * from './lib/search/record-search-source.js';
|
|
31
31
|
// The access cookie, read once and forwarded as a bearer. Three server surfaces
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["// Server-only surface, published as `@entifix/next-shell/server`.\n//\n// It stays a separate entry so route handlers and cookie helpers are never\n// reached through the client surface: stamped as client modules they would\n// become client references and their `next/server` imports would fail. The\n// library compiles per-file, so each module keeps its own `\"use client\"` (or\n// keeps none, as here) instead of inheriting a bundle-wide banner.\n\n// React server components\n\n// Probe route handlers (liveness/readiness) shared by every Next app.\nexport * from './lib/health/health-routes.js';\n\n// The `GET /api/config` handler + the same-origin domain rewrite it applies.\nexport * from './lib/config/config-route.js';\n\n// The shared fleet token, and the header config-service reads it from. Exported\n// because a server component that reads config-service directly — rather than\n// through its own app's `/api/config` route — has to carry it itself. It never\n// reaches the browser: this is the server entry.\nexport * from './lib/config/
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["// Server-only surface, published as `@entifix/next-shell/server`.\n//\n// It stays a separate entry so route handlers and cookie helpers are never\n// reached through the client surface: stamped as client modules they would\n// become client references and their `next/server` imports would fail. The\n// library compiles per-file, so each module keeps its own `\"use client\"` (or\n// keeps none, as here) instead of inheriting a bundle-wide banner.\n\n// React server components\n\n// Probe route handlers (liveness/readiness) shared by every Next app.\nexport * from './lib/health/health-routes.js';\n\n// The `GET /api/config` handler + the same-origin domain rewrite it applies.\nexport * from './lib/config/config-route.js';\n\n// The shared fleet token, and the header config-service reads it from. Exported\n// because a server component that reads config-service directly — rather than\n// through its own app's `/api/config` route — has to carry it itself. It never\n// reaches the browser: this is the server entry.\nexport * from './lib/config/configuration-source.js';\n\n// The same-origin proxy each host mounts per backend it talks to.\nexport * from './lib/config/service-proxy-route.js';\n\n// Session cookies + the shared refresh route handler\nexport * from './lib/session/cookies.js';\nexport * from './lib/session/refresh-route.js';\n\n// The `[slug]` value that means \"create\". A pure constant, exported from both\n// entries because both need it: the generated pages read it in the browser, and\n// a shell's palette commands compose the create route with it on the server.\nexport * from './lib/crud/slug.js';\n\n// The cross-domain record search: the aggregating route, and the declarations a\n// host fans out over.\nexport * from './lib/search/record-search-route.js';\nexport * from './lib/search/record-search-source.js';\n\n// The access cookie, read once and forwarded as a bearer. Three server surfaces\n// carry it the same way — the per-backend proxy, the auth shell's hand-written\n// handlers, and the record search fan-out — and none of them grants anything.\nexport * from './lib/session/bearer.js';\n\n// Account-link builders. Pure functions, but server layouts call them directly,\n// and anything exported from the client entry becomes a client function.\nexport * from './lib/session/account-links.js';\n\n// Device identity — read from the request, written onto the response.\nexport * from './lib/session/device.js';\n"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,mEAAmE;AAEnE,0BAA0B;AAE1B,sEAAsE;AACtE,cAAc,gCAAgC;AAE9C,6EAA6E;AAC7E,cAAc,+BAA+B;AAE7C,gFAAgF;AAChF,8EAA8E;AAC9E,+EAA+E;AAC/E,iDAAiD;AACjD,cAAc,uCAAuC;AAErD,kEAAkE;AAClE,cAAc,sCAAsC;AAEpD,qDAAqD;AACrD,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAE/C,8EAA8E;AAC9E,gFAAgF;AAChF,6EAA6E;AAC7E,cAAc,qBAAqB;AAEnC,gFAAgF;AAChF,sBAAsB;AACtB,cAAc,sCAAsC;AACpD,cAAc,uCAAuC;AAErD,gFAAgF;AAChF,+EAA+E;AAC/E,8EAA8E;AAC9E,cAAc,0BAA0B;AAExC,gFAAgF;AAChF,yEAAyE;AACzE,cAAc,iCAAiC;AAE/C,sEAAsE;AACtE,cAAc,0BAA0B"}
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
"version": "0.
|
|
24
|
+
"version": "0.6.0",
|
|
25
25
|
"description": "Next.js application shell: back-office chrome, workspace tabs, CRUD screens derived from entity metadata, and session and proxy routes.",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"repository": {
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"react": "19.3.1",
|
|
58
58
|
"react-dom": "19.3.1",
|
|
59
59
|
"zustand": "^5.0.15",
|
|
60
|
-
"@entifix/testing-unit": "0.
|
|
60
|
+
"@entifix/testing-unit": "0.6.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"idb": "^8.0.4",
|
|
64
|
-
"@entifix/authz": "0.
|
|
65
|
-
"@entifix/business": "0.
|
|
66
|
-
"@entifix/
|
|
67
|
-
"@entifix/
|
|
68
|
-
"@entifix/react-integration": "0.
|
|
69
|
-
"@entifix/transactions": "0.
|
|
70
|
-
"@entifix/react-controls": "0.
|
|
64
|
+
"@entifix/authz": "0.6.0",
|
|
65
|
+
"@entifix/business": "0.6.0",
|
|
66
|
+
"@entifix/i18n": "0.6.0",
|
|
67
|
+
"@entifix/core": "0.6.0",
|
|
68
|
+
"@entifix/react-integration": "0.6.0",
|
|
69
|
+
"@entifix/transactions": "0.6.0",
|
|
70
|
+
"@entifix/react-controls": "0.6.0"
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
73
|
"dist",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** Header config-service reads the shared fleet token from. */
|
|
2
|
-
export declare const SERVICE_TOKEN_HEADER = "x-service-token";
|
|
3
|
-
/** Read on each call so a test (or a rotated deployment) can change it. */
|
|
4
|
-
export declare const serviceToken: () => string;
|
|
5
|
-
//# sourceMappingURL=service-token.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-token.d.ts","sourceRoot":"","sources":["../../../src/lib/config/service-token.ts"],"names":[],"mappings":"AAaA,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD,2EAA2E;AAC3E,eAAO,MAAM,YAAY,QAAO,MACuB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* config-service's fleet lookup is gated on a shared token, since it serves real
|
|
3
|
-
* connection strings and the JWT signing key. The literal default keeps local dev
|
|
4
|
-
* zero-config; it is replaced per environment through `CONFIG_SERVICE_TOKEN`.
|
|
5
|
-
*
|
|
6
|
-
* This module is server-only, so the token never reaches the browser.
|
|
7
|
-
*
|
|
8
|
-
* It lives on its own because *two* server routes call the gated endpoint: the
|
|
9
|
-
* `/api/config` fetch and the readiness probe. Readiness reaching it without the
|
|
10
|
-
* header is how an app answers `503` forever while being perfectly healthy.
|
|
11
|
-
*/ const DEV_SERVICE_TOKEN = 'dev-config-service-token-change-me';
|
|
12
|
-
/** Header config-service reads the shared fleet token from. */ export const SERVICE_TOKEN_HEADER = 'x-service-token';
|
|
13
|
-
/** Read on each call so a test (or a rotated deployment) can change it. */ export const serviceToken = ()=>{
|
|
14
|
-
var _process_env_CONFIG_SERVICE_TOKEN;
|
|
15
|
-
return (_process_env_CONFIG_SERVICE_TOKEN = process.env.CONFIG_SERVICE_TOKEN) != null ? _process_env_CONFIG_SERVICE_TOKEN : DEV_SERVICE_TOKEN;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=service-token.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/config/service-token.ts"],"sourcesContent":["/**\n * config-service's fleet lookup is gated on a shared token, since it serves real\n * connection strings and the JWT signing key. The literal default keeps local dev\n * zero-config; it is replaced per environment through `CONFIG_SERVICE_TOKEN`.\n *\n * This module is server-only, so the token never reaches the browser.\n *\n * It lives on its own because *two* server routes call the gated endpoint: the\n * `/api/config` fetch and the readiness probe. Readiness reaching it without the\n * header is how an app answers `503` forever while being perfectly healthy.\n */\nconst DEV_SERVICE_TOKEN = 'dev-config-service-token-change-me';\n\n/** Header config-service reads the shared fleet token from. */\nexport const SERVICE_TOKEN_HEADER = 'x-service-token';\n\n/** Read on each call so a test (or a rotated deployment) can change it. */\nexport const serviceToken = (): string =>\n process.env.CONFIG_SERVICE_TOKEN ?? DEV_SERVICE_TOKEN;\n"],"names":["DEV_SERVICE_TOKEN","SERVICE_TOKEN_HEADER","serviceToken","process","env","CONFIG_SERVICE_TOKEN"],"mappings":"AAAA;;;;;;;;;;CAUC,GACD,MAAMA,oBAAoB;AAE1B,6DAA6D,GAC7D,OAAO,MAAMC,uBAAuB,kBAAkB;AAEtD,yEAAyE,GACzE,OAAO,MAAMC,eAAe;QAC1BC;YAAAA,oCAAAA,QAAQC,GAAG,CAACC,oBAAoB,YAAhCF,oCAAoCH;EAAkB"}
|