@simpleapps-com/augur-server 2.2.7 → 2.2.9

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.
@@ -1,32 +0,0 @@
1
- import {
2
- getSiteActionsOrNull
3
- } from "./chunk-EYMB52E5.js";
4
-
5
- // src/query-action.ts
6
- async function queryAction(methodPath, ...args) {
7
- const actions = getSiteActionsOrNull();
8
- if (!actions) {
9
- throw new Error(
10
- "Server actions not initialized. Call createServerSite() or set AUGUR_SITE_ID + AUGUR_JWT env vars."
11
- );
12
- }
13
- const segments = methodPath.split(".");
14
- let current = actions;
15
- for (const segment of segments) {
16
- if (current == null || typeof current !== "object" && typeof current !== "function") {
17
- throw new Error(
18
- `Cannot resolve "${methodPath}": "${segment}" is not accessible on ${typeof current}`
19
- );
20
- }
21
- current = current[segment];
22
- }
23
- if (typeof current !== "function") {
24
- throw new Error(`"${methodPath}" does not resolve to a function (got ${typeof current})`);
25
- }
26
- return current(...args);
27
- }
28
-
29
- export {
30
- queryAction
31
- };
32
- //# sourceMappingURL=chunk-GP6W4BV3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/query-action.ts"],"sourcesContent":["// \"use server\" banner is injected by tsup at build time.\n// Isolated server action for the proxy pattern.\n// This file MUST NOT import from server-actions.ts, server-site-registry.ts,\n// or any factory. It imports only from site-actions-store.ts which has zero\n// transitive dependencies on ioredis, withServerCache, or action factories.\n\nimport { getSiteActionsOrNull } from \"./site-actions-store\";\n\n/**\n * Generic server action that routes any SDK method call through the site\n * actions singleton. Used internally by `createServerQueryProxy()` to\n * bridge client-side React Query hooks to server-side API calls.\n *\n * @param methodPath Dot-separated SDK method path (e.g. \"items.invMast.doc.get\")\n * @param args Arguments to pass to the resolved method\n * @returns The raw result from the SiteActions method\n */\nexport async function queryAction(methodPath: string, ...args: unknown[]): Promise<unknown> {\n const actions = getSiteActionsOrNull();\n if (!actions) {\n throw new Error(\n \"Server actions not initialized. Call createServerSite() or set AUGUR_SITE_ID + AUGUR_JWT env vars.\",\n );\n }\n const segments = methodPath.split(\".\");\n\n let current: unknown = actions;\n for (const segment of segments) {\n if (current == null || (typeof current !== \"object\" && typeof current !== \"function\")) {\n throw new Error(\n `Cannot resolve \"${methodPath}\": \"${segment}\" is not accessible on ${typeof current}`,\n );\n }\n current = (current as Record<string, unknown>)[segment];\n }\n\n if (typeof current !== \"function\") {\n throw new Error(`\"${methodPath}\" does not resolve to a function (got ${typeof current})`);\n }\n\n return (current as (...a: unknown[]) => Promise<unknown>)(...args);\n}\n"],"mappings":";;;;;AAiBA,eAAsB,YAAY,eAAuB,MAAmC;AAC1F,QAAM,UAAU,qBAAqB;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,QAAM,WAAW,WAAW,MAAM,GAAG;AAErC,MAAI,UAAmB;AACvB,aAAW,WAAW,UAAU;AAC9B,QAAI,WAAW,QAAS,OAAO,YAAY,YAAY,OAAO,YAAY,YAAa;AACrF,YAAM,IAAI;AAAA,QACR,mBAAmB,UAAU,OAAO,OAAO,0BAA0B,OAAO,OAAO;AAAA,MACrF;AAAA,IACF;AACA,cAAW,QAAoC,OAAO;AAAA,EACxD;AAEA,MAAI,OAAO,YAAY,YAAY;AACjC,UAAM,IAAI,MAAM,IAAI,UAAU,yCAAyC,OAAO,OAAO,GAAG;AAAA,EAC1F;AAEA,SAAQ,QAAkD,GAAG,IAAI;AACnE;","names":[]}