@simpleapps-com/augur-server 2.2.3 → 2.2.5
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/actions.d.ts +2 -11
- package/dist/actions.js +418 -136
- package/dist/actions.js.map +1 -1
- package/dist/{chunk-MUTPMHZW.js → chunk-3N37FS5N.js} +16 -20
- package/dist/chunk-3N37FS5N.js.map +1 -0
- package/dist/chunk-EYMB52E5.js +28 -0
- package/dist/chunk-EYMB52E5.js.map +1 -0
- package/dist/chunk-GP6W4BV3.js +32 -0
- package/dist/chunk-GP6W4BV3.js.map +1 -0
- package/dist/hooks.d.ts +7 -15
- package/dist/hooks.js +8 -6
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/query-action.d.ts +12 -0
- package/dist/query-action.js +10 -0
- package/dist/query-action.js.map +1 -0
- package/dist/{server-site-registry-5JIrOo05.d.ts → server-site-registry-CB7eqDcW.d.ts} +17 -0
- package/dist/site.js +2 -1
- package/dist/site.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -1
- package/dist/testing.js.map +1 -1
- package/package.json +9 -5
- package/dist/chunk-MUTPMHZW.js.map +0 -1
- package/dist/chunk-ZXTBD32L.js +0 -570
- package/dist/chunk-ZXTBD32L.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { OptionsProxyConfig, DeepQueryOptions } from '@simpleapps-com/augur-core';
|
|
2
2
|
|
|
3
|
+
/** Server action function signature accepted by createServerQueryProxy. */
|
|
4
|
+
type QueryActionFn = (methodPath: string, ...args: unknown[]) => Promise<unknown>;
|
|
3
5
|
/**
|
|
4
6
|
* Creates a client-side proxy that mirrors the SDK namespace and routes
|
|
5
|
-
* every method call through a
|
|
7
|
+
* every method call through a server action function.
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* mutation options with mutationKey and mutationFn.
|
|
10
|
-
*
|
|
11
|
-
* queryFn calls the generic `queryAction` server function, which resolves
|
|
12
|
-
* the method through `getSiteActions()` on the server. No SDK instance is
|
|
13
|
-
* needed on the client.
|
|
14
|
-
*
|
|
15
|
-
* QueryKeys are identical to `createOptionsProxy` and `createKeysOnlyProxy`,
|
|
16
|
-
* so SSR hydration via `createAugurOptions()` works automatically.
|
|
17
|
-
*
|
|
18
|
-
* @param config Optional cache configuration overrides
|
|
9
|
+
* The `queryAction` parameter is optional. If omitted, it uses the built-in
|
|
10
|
+
* server action from `@simpleapps-com/augur-server/query-action`.
|
|
19
11
|
*
|
|
20
12
|
* @example
|
|
21
13
|
* ```tsx
|
|
@@ -38,6 +30,6 @@ import { OptionsProxyConfig, DeepQueryOptions } from '@simpleapps-com/augur-core
|
|
|
38
30
|
* const addToCart = useMutation(q.commerce.cartLine.add.create());
|
|
39
31
|
* ```
|
|
40
32
|
*/
|
|
41
|
-
declare function createServerQueryProxy<TApi extends object = object>(config?: OptionsProxyConfig): DeepQueryOptions<TApi>;
|
|
33
|
+
declare function createServerQueryProxy<TApi extends object = object>(queryActionOrConfig?: QueryActionFn | OptionsProxyConfig, config?: OptionsProxyConfig): DeepQueryOptions<TApi>;
|
|
42
34
|
|
|
43
|
-
export { createServerQueryProxy };
|
|
35
|
+
export { type QueryActionFn, createServerQueryProxy };
|
package/dist/hooks.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
queryAction
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-GP6W4BV3.js";
|
|
5
|
+
import "./chunk-EYMB52E5.js";
|
|
6
6
|
import "./chunk-DGUM43GV.js";
|
|
7
7
|
|
|
8
8
|
// src/hooks.ts
|
|
@@ -13,24 +13,26 @@ import {
|
|
|
13
13
|
buildQueryKey,
|
|
14
14
|
stableArgs
|
|
15
15
|
} from "@simpleapps-com/augur-core";
|
|
16
|
-
function createServerQueryProxy(config) {
|
|
16
|
+
function createServerQueryProxy(queryActionOrConfig, config) {
|
|
17
|
+
const queryAction2 = typeof queryActionOrConfig === "function" ? queryActionOrConfig : queryAction;
|
|
18
|
+
const resolvedConfig = typeof queryActionOrConfig === "function" ? config : queryActionOrConfig;
|
|
17
19
|
return createDeepProxy(
|
|
18
20
|
(path, args) => {
|
|
19
21
|
const methodName = path[path.length - 1];
|
|
20
22
|
const methodPath = path.join(".");
|
|
21
23
|
const normalizedArgs = stableArgs(args);
|
|
22
24
|
if (isReadMethod(methodName)) {
|
|
23
|
-
const tier = getCacheTier(methodPath,
|
|
25
|
+
const tier = getCacheTier(methodPath, resolvedConfig?.cache);
|
|
24
26
|
return {
|
|
25
27
|
queryKey: buildQueryKey(path, normalizedArgs),
|
|
26
|
-
queryFn: () =>
|
|
28
|
+
queryFn: () => queryAction2(methodPath, ...args),
|
|
27
29
|
staleTime: tier.staleTime,
|
|
28
30
|
gcTime: tier.gcTime
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
return {
|
|
32
34
|
mutationKey: path,
|
|
33
|
-
mutationFn: (...mutationArgs) =>
|
|
35
|
+
mutationFn: (...mutationArgs) => queryAction2(methodPath, ...mutationArgs)
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
);
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks.ts"],"sourcesContent":["// \"use client\" banner is injected by tsup at build time.\n// Client-side proxy that generates React Query options backed by server actions.\n\nimport {\n createDeepProxy,\n isReadMethod,\n getCacheTier,\n buildQueryKey,\n stableArgs,\n} from \"@simpleapps-com/augur-core\";\nimport type {\n DeepQueryOptions,\n OptionsProxyConfig,\n ProxyQueryOptions,\n ProxyMutationOptions,\n} from \"@simpleapps-com/augur-core\";\nimport { queryAction } from \"./
|
|
1
|
+
{"version":3,"sources":["../src/hooks.ts"],"sourcesContent":["// \"use client\" banner is injected by tsup at build time.\n// Client-side proxy that generates React Query options backed by server actions.\n//\n// IMPORTANT: This file MUST NOT import from server-actions.ts or any module\n// that transitively depends on ioredis/withServerCache/action factories.\n// The queryAction import comes from query-action.ts which only depends on\n// site-actions-store.ts (a lightweight globalThis getter with zero deps).\n\nimport {\n createDeepProxy,\n isReadMethod,\n getCacheTier,\n buildQueryKey,\n stableArgs,\n} from \"@simpleapps-com/augur-core\";\nimport type {\n DeepQueryOptions,\n OptionsProxyConfig,\n ProxyQueryOptions,\n ProxyMutationOptions,\n} from \"@simpleapps-com/augur-core\";\nimport { queryAction as defaultQueryAction } from \"./query-action\";\n\n/** Server action function signature accepted by createServerQueryProxy. */\nexport type QueryActionFn = (methodPath: string, ...args: unknown[]) => Promise<unknown>;\n\n/**\n * Creates a client-side proxy that mirrors the SDK namespace and routes\n * every method call through a server action function.\n *\n * The `queryAction` parameter is optional. If omitted, it uses the built-in\n * server action from `@simpleapps-com/augur-server/query-action`.\n *\n * @example\n * ```tsx\n * import { createServerQueryProxy } from \"@simpleapps-com/augur-server/hooks\";\n *\n * const q = createServerQueryProxy();\n *\n * // Reads — any SDK method, routed through server actions\n * const { data: item } = useQuery(q.items.invMast.doc.get(42));\n * const { data: price } = useQuery(q.pricing.priceEngine.get({ itemId, customerId }));\n *\n * // Infinite queries — spread and add infinite-specific options\n * const { data, fetchNextPage } = useInfiniteQuery({\n * ...q.items.itemCategory.categoryItems.get(uid, filters),\n * getNextPageParam: (lastPage) => lastPage.nextCursor,\n * initialPageParam: 0,\n * });\n *\n * // Mutations — write methods return mutation options\n * const addToCart = useMutation(q.commerce.cartLine.add.create());\n * ```\n */\nexport function createServerQueryProxy<TApi extends object = object>(\n queryActionOrConfig?: QueryActionFn | OptionsProxyConfig,\n config?: OptionsProxyConfig,\n): DeepQueryOptions<TApi> {\n const queryAction =\n typeof queryActionOrConfig === \"function\" ? queryActionOrConfig : defaultQueryAction;\n const resolvedConfig = typeof queryActionOrConfig === \"function\" ? config : queryActionOrConfig;\n\n return createDeepProxy(\n (\n path: string[],\n args: unknown[],\n ): ProxyQueryOptions<unknown> | ProxyMutationOptions<unknown, unknown[]> => {\n const methodName = path[path.length - 1]!;\n const methodPath = path.join(\".\");\n const normalizedArgs = stableArgs(args);\n\n if (isReadMethod(methodName)) {\n const tier = getCacheTier(methodPath, resolvedConfig?.cache);\n return {\n queryKey: buildQueryKey(path, normalizedArgs),\n queryFn: () => queryAction(methodPath, ...args),\n staleTime: tier.staleTime,\n gcTime: tier.gcTime,\n };\n }\n\n return {\n mutationKey: path,\n mutationFn: (...mutationArgs: unknown[]) => queryAction(methodPath, ...mutationArgs),\n };\n },\n ) as DeepQueryOptions<TApi>;\n}\n"],"mappings":";;;;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAwCA,SAAS,uBACd,qBACA,QACwB;AACxB,QAAMA,eACJ,OAAO,wBAAwB,aAAa,sBAAsB;AACpE,QAAM,iBAAiB,OAAO,wBAAwB,aAAa,SAAS;AAE5E,SAAO;AAAA,IACL,CACE,MACA,SAC0E;AAC1E,YAAM,aAAa,KAAK,KAAK,SAAS,CAAC;AACvC,YAAM,aAAa,KAAK,KAAK,GAAG;AAChC,YAAM,iBAAiB,WAAW,IAAI;AAEtC,UAAI,aAAa,UAAU,GAAG;AAC5B,cAAM,OAAO,aAAa,YAAY,gBAAgB,KAAK;AAC3D,eAAO;AAAA,UACL,UAAU,cAAc,MAAM,cAAc;AAAA,UAC5C,SAAS,MAAMA,aAAY,YAAY,GAAG,IAAI;AAAA,UAC9C,WAAW,KAAK;AAAA,UAChB,QAAQ,KAAK;AAAA,QACf;AAAA,MACF;AAEA,aAAO;AAAA,QACL,aAAa;AAAA,QACb,YAAY,IAAI,iBAA4BA,aAAY,YAAY,GAAG,YAAY;AAAA,MACrF;AAAA,IACF;AAAA,EACF;AACF;","names":["queryAction"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { QueryClient } from '@tanstack/react-query';
|
|
|
4
4
|
export { QueryOptionsConfig, createQueryOptions, createSuspenseQueryOptions } from './query.js';
|
|
5
5
|
export { P as PaginatedResult, p as paginateOffset } from './smarty-streets-BnEIKoi8.js';
|
|
6
6
|
export { S as SiteActions, a as SiteActionsConfig, c as createSiteActions } from './site-BCs1qE_m.js';
|
|
7
|
-
export { g as getSiteActions, r as registerSiteActions } from './server-site-registry-
|
|
7
|
+
export { g as getSiteActions, r as registerSiteActions } from './server-site-registry-CB7eqDcW.js';
|
|
8
8
|
export { ActionResult, EdgeCacheValue } from '@simpleapps-com/augur-core';
|
|
9
9
|
|
|
10
10
|
/** Resolved environment: `"development"`, `"staging"`, or `"production"`. */
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server-query-client.ts","../src/recaptcha.ts"],"sourcesContent":["import { cache } from \"react\";\nimport { QueryClient } from \"@tanstack/react-query\";\nimport { CACHE_CONFIG } from \"@simpleapps-com/augur-utils\";\n\n/**\n * Creates a server-side query client optimised for prefetching.\n *\n * - No persistence (server-only)\n * - Longer cache times for prefetched data\n * - No retries (fail fast on server)\n * - No refetching (server renders are one-shot)\n */\nexport function createServerQueryClient(): QueryClient {\n return new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: CACHE_CONFIG.STATIC.staleTime,\n gcTime: CACHE_CONFIG.STATIC.staleTime,\n retry: 0,\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n },\n },\n });\n}\n\n/**\n * Returns a per-request singleton QueryClient for React Server Components.\n *\n * React's `cache()` deduplicates calls within a single server request,\n * so each request gets its own QueryClient while avoiding the cross-request\n * state leakage that a module-level singleton would cause.\n */\nexport const getServerQueryClient = cache((): QueryClient => createServerQueryClient());\n","/**\n * Server-side Google reCAPTCHA v3 verification.\n * Used by API routes that accept public form submissions.\n */\nexport async function verifyRecaptcha(token: string): Promise<boolean> {\n try {\n const secretKey = process.env[\"RECAPTCHA_SECRET_KEY\"];\n if (!secretKey) return false;\n\n const res = await fetch(\"https://www.google.com/recaptcha/api/siteverify\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n body: new URLSearchParams({ secret: secretKey, response: token }),\n });\n if (!res.ok) {\n console.error(\"reCAPTCHA verify failed:\", res.status);\n return false;\n }\n const result = (await res.json()) as { success?: boolean };\n return result.success === true;\n } catch (error) {\n console.error(\"reCAPTCHA verify error:\", error);\n return false;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/server-query-client.ts","../src/recaptcha.ts"],"sourcesContent":["import { cache } from \"react\";\nimport { QueryClient } from \"@tanstack/react-query\";\nimport { CACHE_CONFIG } from \"@simpleapps-com/augur-utils\";\n\n/**\n * Creates a server-side query client optimised for prefetching.\n *\n * - No persistence (server-only)\n * - Longer cache times for prefetched data\n * - No retries (fail fast on server)\n * - No refetching (server renders are one-shot)\n */\nexport function createServerQueryClient(): QueryClient {\n return new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: CACHE_CONFIG.STATIC.staleTime,\n gcTime: CACHE_CONFIG.STATIC.staleTime,\n retry: 0,\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n },\n },\n });\n}\n\n/**\n * Returns a per-request singleton QueryClient for React Server Components.\n *\n * React's `cache()` deduplicates calls within a single server request,\n * so each request gets its own QueryClient while avoiding the cross-request\n * state leakage that a module-level singleton would cause.\n */\nexport const getServerQueryClient = cache((): QueryClient => createServerQueryClient());\n","/**\n * Server-side Google reCAPTCHA v3 verification.\n * Used by API routes that accept public form submissions.\n */\nexport async function verifyRecaptcha(token: string): Promise<boolean> {\n try {\n const secretKey = process.env[\"RECAPTCHA_SECRET_KEY\"];\n if (!secretKey) return false;\n\n const res = await fetch(\"https://www.google.com/recaptcha/api/siteverify\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n body: new URLSearchParams({ secret: secretKey, response: token }),\n });\n if (!res.ok) {\n console.error(\"reCAPTCHA verify failed:\", res.status);\n return false;\n }\n const result = (await res.json()) as { success?: boolean };\n return result.success === true;\n } catch (error) {\n console.error(\"reCAPTCHA verify error:\", error);\n return false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAUtB,SAAS,0BAAuC;AACrD,SAAO,IAAI,YAAY;AAAA,IACrB,gBAAgB;AAAA,MACd,SAAS;AAAA,QACP,WAAW,aAAa,OAAO;AAAA,QAC/B,QAAQ,aAAa,OAAO;AAAA,QAC5B,OAAO;AAAA,QACP,gBAAgB;AAAA,QAChB,sBAAsB;AAAA,QACtB,oBAAoB;AAAA,MACtB;AAAA,IACF;AAAA,EACF,CAAC;AACH;AASO,IAAM,uBAAuB,MAAM,MAAmB,wBAAwB,CAAC;;;AC9BtF,eAAsB,gBAAgB,OAAiC;AACrE,MAAI;AACF,UAAM,YAAY,QAAQ,IAAI,sBAAsB;AACpD,QAAI,CAAC,UAAW,QAAO;AAEvB,UAAM,MAAM,MAAM,MAAM,mDAAmD;AAAA,MACzE,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,oCAAoC;AAAA,MAC/D,MAAM,IAAI,gBAAgB,EAAE,QAAQ,WAAW,UAAU,MAAM,CAAC;AAAA,IAClE,CAAC;AACD,QAAI,CAAC,IAAI,IAAI;AACX,cAAQ,MAAM,4BAA4B,IAAI,MAAM;AACpD,aAAO;AAAA,IACT;AACA,UAAM,SAAU,MAAM,IAAI,KAAK;AAC/B,WAAO,OAAO,YAAY;AAAA,EAC5B,SAAS,OAAO;AACd,YAAQ,MAAM,2BAA2B,KAAK;AAC9C,WAAO;AAAA,EACT;AACF;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic server action that routes any SDK method call through the site
|
|
3
|
+
* actions singleton. Used internally by `createServerQueryProxy()` to
|
|
4
|
+
* bridge client-side React Query hooks to server-side API calls.
|
|
5
|
+
*
|
|
6
|
+
* @param methodPath Dot-separated SDK method path (e.g. "items.invMast.doc.get")
|
|
7
|
+
* @param args Arguments to pass to the resolved method
|
|
8
|
+
* @returns The raw result from the SiteActions method
|
|
9
|
+
*/
|
|
10
|
+
declare function queryAction(methodPath: string, ...args: unknown[]): Promise<unknown>;
|
|
11
|
+
|
|
12
|
+
export { queryAction };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { S as SiteActions } from './site-BCs1qE_m.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Process-global storage for the site actions singleton.
|
|
5
|
+
*
|
|
6
|
+
* Uses `globalThis` so the registry survives across bundler scope boundaries.
|
|
7
|
+
* Next.js may bundle package server actions into a separate chunk with their
|
|
8
|
+
* own copy of this module; `globalThis` ensures all copies share the same
|
|
9
|
+
* instance.
|
|
10
|
+
*
|
|
11
|
+
* A module-level `_cachedActions` variable acts as a secondary cache for when
|
|
12
|
+
* `globalThis` is reset (Next.js 16 production standalone mode clears
|
|
13
|
+
* `globalThis` on dynamic routes -- see vercel/next.js#74204).
|
|
14
|
+
*
|
|
15
|
+
* As a last resort, if both caches are empty, `getSiteActions()` will
|
|
16
|
+
* auto-initialize from `AUGUR_SITE_ID` + `JWT` environment variables.
|
|
17
|
+
* This self-healing behaviour prevents crashes when Next.js loses the
|
|
18
|
+
* singleton across webpack bundle boundaries.
|
|
19
|
+
*/
|
|
3
20
|
/**
|
|
4
21
|
* Stores the site actions instance for use by server action exports.
|
|
5
22
|
* Called automatically by {@link createServerSite}.
|
package/dist/site.js
CHANGED
package/dist/site.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server-site.ts"],"sourcesContent":["import { createSiteActions } from \"./actions/site\";\nimport type { SiteActionsConfig, SiteActions } from \"./actions/site\";\nimport { createAuthConfig } from \"./auth\";\nimport type { AugurAuthCallbacks, AugurAuthClient } from \"./auth\";\nimport type { NextAuthConfig } from \"next-auth\";\nimport { registerSiteActions } from \"./server-site-registry\";\n\n/** Auth options forwarded to NextAuth when creating a server site. */\nexport interface ServerSiteAuthConfig {\n secret?: string;\n maxAge?: number;\n callbacks?: Partial<AugurAuthCallbacks>;\n debug?: boolean;\n}\n\n/** Configuration for {@link createServerSite}, combining action config and auth. */\nexport interface ServerSiteConfig extends SiteActionsConfig {\n auth?: ServerSiteAuthConfig;\n}\n\n/** The object returned by {@link createServerSite}. */\nexport interface ServerSite<TApi extends object> {\n client: TApi;\n actions: SiteActions;\n auth: NextAuthConfig | undefined;\n}\n\n/**\n * Create a server-side site instance that bundles the SDK client, server\n * actions, and (optional) NextAuth configuration.\n *\n * @example\n * ```ts\n * import { AugurApi } from \"@simpleapps-com/augur-api\";\n * import { createServerSite } from \"@simpleapps-com/augur-server\";\n *\n * const api = new AugurApi({ baseUrl: process.env.AUGUR_API_URL! });\n * export const site = createServerSite(api, {\n * defaultCustomerId: \"12345\",\n * auth: { secret: process.env.AUTH_SECRET },\n * });\n * ```\n */\nexport function createServerSite<TApi extends object>(\n client: TApi,\n config: ServerSiteConfig = {},\n): ServerSite<TApi> {\n const actions = createSiteActions(client, config);\n registerSiteActions(actions);\n\n const auth = config.auth\n ? createAuthConfig({\n augurClient: client as unknown as AugurAuthClient,\n defaultCustomerId: config.defaultCustomerId,\n defaultContactId: config.defaultContactId,\n ...config.auth,\n })\n : undefined;\n\n return { client, actions, auth };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/server-site.ts"],"sourcesContent":["import { createSiteActions } from \"./actions/site\";\nimport type { SiteActionsConfig, SiteActions } from \"./actions/site\";\nimport { createAuthConfig } from \"./auth\";\nimport type { AugurAuthCallbacks, AugurAuthClient } from \"./auth\";\nimport type { NextAuthConfig } from \"next-auth\";\nimport { registerSiteActions } from \"./server-site-registry\";\n\n/** Auth options forwarded to NextAuth when creating a server site. */\nexport interface ServerSiteAuthConfig {\n secret?: string;\n maxAge?: number;\n callbacks?: Partial<AugurAuthCallbacks>;\n debug?: boolean;\n}\n\n/** Configuration for {@link createServerSite}, combining action config and auth. */\nexport interface ServerSiteConfig extends SiteActionsConfig {\n auth?: ServerSiteAuthConfig;\n}\n\n/** The object returned by {@link createServerSite}. */\nexport interface ServerSite<TApi extends object> {\n client: TApi;\n actions: SiteActions;\n auth: NextAuthConfig | undefined;\n}\n\n/**\n * Create a server-side site instance that bundles the SDK client, server\n * actions, and (optional) NextAuth configuration.\n *\n * @example\n * ```ts\n * import { AugurApi } from \"@simpleapps-com/augur-api\";\n * import { createServerSite } from \"@simpleapps-com/augur-server\";\n *\n * const api = new AugurApi({ baseUrl: process.env.AUGUR_API_URL! });\n * export const site = createServerSite(api, {\n * defaultCustomerId: \"12345\",\n * auth: { secret: process.env.AUTH_SECRET },\n * });\n * ```\n */\nexport function createServerSite<TApi extends object>(\n client: TApi,\n config: ServerSiteConfig = {},\n): ServerSite<TApi> {\n const actions = createSiteActions(client, config);\n registerSiteActions(actions);\n\n const auth = config.auth\n ? createAuthConfig({\n augurClient: client as unknown as AugurAuthClient,\n defaultCustomerId: config.defaultCustomerId,\n defaultContactId: config.defaultContactId,\n ...config.auth,\n })\n : undefined;\n\n return { client, actions, auth };\n}\n"],"mappings":";;;;;;;;;;;AA2CO,SAAS,iBACd,QACA,SAA2B,CAAC,GACV;AAClB,QAAM,UAAU,kBAAkB,QAAQ,MAAM;AAChD,sBAAoB,OAAO;AAE3B,QAAM,OAAO,OAAO,OAChB,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,mBAAmB,OAAO;AAAA,IAC1B,kBAAkB,OAAO;AAAA,IACzB,GAAG,OAAO;AAAA,EACZ,CAAC,IACD;AAEJ,SAAO,EAAE,QAAQ,SAAS,KAAK;AACjC;","names":[]}
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DeepMockClient, MockClientResult, createMockClient } from '@simpleapps-com/augur-core/testing';
|
|
2
|
-
export { c as clearSiteActions } from './server-site-registry-
|
|
2
|
+
export { c as clearSiteActions } from './server-site-registry-CB7eqDcW.js';
|
|
3
3
|
import { S as SiteActions } from './site-BCs1qE_m.js';
|
|
4
4
|
import '@simpleapps-com/augur-core';
|
|
5
5
|
import '@simpleapps-com/augur-utils';
|
package/dist/testing.js
CHANGED
package/dist/testing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/testing.ts"],"sourcesContent":["export { createMockClient } from \"@simpleapps-com/augur-core/testing\";\nexport { clearSiteActions } from \"./server-site-registry\";\nexport type { DeepMockClient, MockClientResult } from \"@simpleapps-com/augur-core/testing\";\n\nimport type { SiteActions } from \"./actions/site\";\n\n/**\n * A mock function type compatible with both Vitest and Jest.\n * Supports `.mockResolvedValue()`, `.mockRejectedValue()`, and call tracking.\n */\nexport interface MockFn {\n (...args: unknown[]): unknown;\n mockResolvedValue: (value: unknown) => MockFn;\n mockRejectedValue: (value: unknown) => MockFn;\n mockReturnValue: (value: unknown) => MockFn;\n mockImplementation: (fn: (...args: unknown[]) => unknown) => MockFn;\n mock: { calls: unknown[][] };\n}\n\n/** Mirror of SiteActions where every method is a MockFn. */\nexport type MockSiteActions = {\n [K in keyof SiteActions]: {\n [M in keyof SiteActions[K]]: MockFn;\n };\n};\n\n/** Return type of createMockSiteActions. */\nexport interface MockSiteActionsResult {\n /** Typed as SiteActions — pass this to your components/server actions. */\n actions: SiteActions;\n /** Same object typed with MockFn — use for assertions and mock setup. */\n mocks: MockSiteActions;\n}\n\n/** Shape definition: service name → method names. */\nconst SERVICE_METHODS: Record<string, string[]> = {\n pricing: [\"getItemPrice\", \"batchGetItemPrices\", \"getTaxEstimate\"],\n items: [\n \"itemCategoryLookup\",\n \"getItemCategory\",\n \"getCategoryItems\",\n \"getCategoryItemsInfinite\",\n \"getItemAttributes\",\n \"getInvMast\",\n \"getInvMastDoc\",\n \"getStock\",\n \"getStockCompanySummary\",\n \"getItemFaqs\",\n \"getItemSubstitutes\",\n \"getItemAccessories\",\n \"getSimilarItems\",\n \"batchGetInvMastDocs\",\n \"batchGetStockData\",\n ],\n commerce: [\n \"cartHdrLookup\",\n \"getCartLines\",\n \"addToCart\",\n \"updateCartLines\",\n \"deleteCartItems\",\n \"getCartAlsoBought\",\n \"checkoutOrder\",\n ],\n search: [\"getSearchAttributes\", \"getSearchSuggestions\", \"itemSearch\", \"itemSearchInfinite\"],\n orders: [\"getOrderDoc\"],\n shipping: [\"getShippingRates\"],\n joomla: [\n \"getJoomlaContent\",\n \"getJoomlaContentList\",\n \"getJoomlaMenu\",\n \"getJoomlaMenuDoc\",\n \"getUserProfile\",\n \"verifyPassword\",\n ],\n legacy: [\"getItemWebDesc\", \"getAlsoBoughtItems\", \"getItemTags\", \"getStates\"],\n customers: [\n \"getCustomer\",\n \"customerLookup\",\n \"getCustomerDoc\",\n \"getCustomerOrders\",\n \"getCustomerOrderDetail\",\n \"getCustomerInvoices\",\n \"getCustomerInvoiceDetail\",\n \"getCustomerQuotes\",\n \"getCustomerQuoteDetail\",\n \"getContacts\",\n \"getShipToAddresses\",\n ],\n smartyStreets: [\"validateAddress\"],\n p21Pim: [\"getInvMastExt\", \"listInvMastExt\"],\n agrSite: [\"getSettings\", \"getMetaFiles\"],\n avalara: [\"calculateTax\"],\n payments: [\n \"transactionSetup\",\n \"accountQuery\",\n \"getSurcharge\",\n \"cardInfo\",\n \"billingUpdate\",\n \"validatePayment\",\n ],\n ups: [\"getRates\"],\n logistics: [\"getFreightRates\", \"getShipVia\"],\n nexus: [\n \"createBinTransfer\",\n \"createReceiving\",\n \"createTransfer\",\n \"getPurchaseOrderReceipts\",\n \"getTransferReceipts\",\n \"getTransferShipping\",\n ],\n vmi: [\n \"getWarehouses\",\n \"getWarehouseAvailability\",\n \"getDistributors\",\n \"getProducts\",\n \"getInventoryProfiles\",\n \"getRestockHeaders\",\n \"getSections\",\n ],\n p21Core: [\n \"getAddresses\",\n \"getCompanies\",\n \"getCompany\",\n \"getLocations\",\n \"getPaymentTypes\",\n \"getCashDrawers\",\n \"getCodeP21\",\n ],\n p21Apis: [\n \"getCategories\",\n \"getCategoryDefaults\",\n \"getCompanies\",\n \"getUsers\",\n \"getWebDisplayTypes\",\n \"getWebDisplayTypeDefaults\",\n \"refreshContacts\",\n \"refreshCustomers\",\n ],\n p21Sism: [\"getRecentImports\", \"getImport\", \"getImportLines\", \"getScheduledImports\"],\n agrWork: [\"healthCheck\", \"ping\"],\n agrInfo: [\"getContext\", \"getRubrics\", \"getMicroservices\", \"generateAkasha\", \"generateJoomla\"],\n basecamp2: [\n \"getTodos\",\n \"getTodo\",\n \"getTodosSummary\",\n \"getComments\",\n \"getPeople\",\n \"getProjects\",\n \"getEvents\",\n \"getMetrics\",\n \"getTodolists\",\n ],\n brandFolder: [\"getCategories\", \"getCategory\", \"createFocus\"],\n gregorovich: [\"askChatGpt\", \"getDocuments\", \"createDocument\", \"generateOllama\"],\n slack: [\"sendWebhook\", \"getWebhooks\"],\n favorites: [\"getFavorites\", \"addFavorite\", \"removeFavorite\"],\n wishlists: [\n \"getWishlists\",\n \"createWishlist\",\n \"getWishlistDetail\",\n \"deleteWishlist\",\n \"addWishlistItems\",\n \"removeWishlistItem\",\n ],\n};\n\nfunction createStubFn(): MockFn {\n const calls: unknown[][] = [];\n\n const fn = ((...args: unknown[]) => {\n calls.push(args);\n const impl = (fn as MockFnInternal)._impl;\n return impl ? impl(...args) : undefined;\n }) as MockFn & MockFnInternal;\n\n fn._impl = undefined;\n fn.mock = { calls };\n\n fn.mockResolvedValue = (value: unknown) => {\n fn._impl = () => Promise.resolve(value);\n return fn;\n };\n\n fn.mockRejectedValue = (value: unknown) => {\n fn._impl = () => Promise.reject(value);\n return fn;\n };\n\n fn.mockReturnValue = (value: unknown) => {\n fn._impl = () => value;\n return fn;\n };\n\n fn.mockImplementation = (impl: (...args: unknown[]) => unknown) => {\n fn._impl = impl;\n return fn;\n };\n\n return fn;\n}\n\ninterface MockFnInternal {\n _impl: ((...args: unknown[]) => unknown) | undefined;\n}\n\n/**\n * Creates a fully-mocked SiteActions object for testing.\n *\n * Every method on every service is a stub function with call tracking\n * and `.mockResolvedValue()` / `.mockReturnValue()` support.\n * Works with both Vitest and Jest — no framework dependency.\n *\n * @example\n * ```ts\n * import { createMockSiteActions } from \"@simpleapps-com/augur-server/testing\";\n *\n * const { actions, mocks } = createMockSiteActions();\n *\n * // Setup return values\n * mocks.pricing.getItemPrice.mockResolvedValue({ price: 9.99 });\n *\n * // Pass actions to your component/server action\n * const price = await actions.pricing.getItemPrice(\"ITEM-1\");\n *\n * // Assert calls\n * expect(mocks.pricing.getItemPrice.mock.calls[0]).toEqual([\"ITEM-1\"]);\n * ```\n */\nexport function createMockSiteActions(): MockSiteActionsResult {\n const result: Record<string, Record<string, MockFn>> = {};\n\n for (const [service, methods] of Object.entries(SERVICE_METHODS)) {\n const serviceMock: Record<string, MockFn> = {};\n for (const method of methods) {\n serviceMock[method] = createStubFn();\n }\n result[service] = serviceMock;\n }\n\n return {\n actions: result as unknown as SiteActions,\n mocks: result as unknown as MockSiteActions,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/testing.ts"],"sourcesContent":["export { createMockClient } from \"@simpleapps-com/augur-core/testing\";\nexport { clearSiteActions } from \"./server-site-registry\";\nexport type { DeepMockClient, MockClientResult } from \"@simpleapps-com/augur-core/testing\";\n\nimport type { SiteActions } from \"./actions/site\";\n\n/**\n * A mock function type compatible with both Vitest and Jest.\n * Supports `.mockResolvedValue()`, `.mockRejectedValue()`, and call tracking.\n */\nexport interface MockFn {\n (...args: unknown[]): unknown;\n mockResolvedValue: (value: unknown) => MockFn;\n mockRejectedValue: (value: unknown) => MockFn;\n mockReturnValue: (value: unknown) => MockFn;\n mockImplementation: (fn: (...args: unknown[]) => unknown) => MockFn;\n mock: { calls: unknown[][] };\n}\n\n/** Mirror of SiteActions where every method is a MockFn. */\nexport type MockSiteActions = {\n [K in keyof SiteActions]: {\n [M in keyof SiteActions[K]]: MockFn;\n };\n};\n\n/** Return type of createMockSiteActions. */\nexport interface MockSiteActionsResult {\n /** Typed as SiteActions — pass this to your components/server actions. */\n actions: SiteActions;\n /** Same object typed with MockFn — use for assertions and mock setup. */\n mocks: MockSiteActions;\n}\n\n/** Shape definition: service name → method names. */\nconst SERVICE_METHODS: Record<string, string[]> = {\n pricing: [\"getItemPrice\", \"batchGetItemPrices\", \"getTaxEstimate\"],\n items: [\n \"itemCategoryLookup\",\n \"getItemCategory\",\n \"getCategoryItems\",\n \"getCategoryItemsInfinite\",\n \"getItemAttributes\",\n \"getInvMast\",\n \"getInvMastDoc\",\n \"getStock\",\n \"getStockCompanySummary\",\n \"getItemFaqs\",\n \"getItemSubstitutes\",\n \"getItemAccessories\",\n \"getSimilarItems\",\n \"batchGetInvMastDocs\",\n \"batchGetStockData\",\n ],\n commerce: [\n \"cartHdrLookup\",\n \"getCartLines\",\n \"addToCart\",\n \"updateCartLines\",\n \"deleteCartItems\",\n \"getCartAlsoBought\",\n \"checkoutOrder\",\n ],\n search: [\"getSearchAttributes\", \"getSearchSuggestions\", \"itemSearch\", \"itemSearchInfinite\"],\n orders: [\"getOrderDoc\"],\n shipping: [\"getShippingRates\"],\n joomla: [\n \"getJoomlaContent\",\n \"getJoomlaContentList\",\n \"getJoomlaMenu\",\n \"getJoomlaMenuDoc\",\n \"getUserProfile\",\n \"verifyPassword\",\n ],\n legacy: [\"getItemWebDesc\", \"getAlsoBoughtItems\", \"getItemTags\", \"getStates\"],\n customers: [\n \"getCustomer\",\n \"customerLookup\",\n \"getCustomerDoc\",\n \"getCustomerOrders\",\n \"getCustomerOrderDetail\",\n \"getCustomerInvoices\",\n \"getCustomerInvoiceDetail\",\n \"getCustomerQuotes\",\n \"getCustomerQuoteDetail\",\n \"getContacts\",\n \"getShipToAddresses\",\n ],\n smartyStreets: [\"validateAddress\"],\n p21Pim: [\"getInvMastExt\", \"listInvMastExt\"],\n agrSite: [\"getSettings\", \"getMetaFiles\"],\n avalara: [\"calculateTax\"],\n payments: [\n \"transactionSetup\",\n \"accountQuery\",\n \"getSurcharge\",\n \"cardInfo\",\n \"billingUpdate\",\n \"validatePayment\",\n ],\n ups: [\"getRates\"],\n logistics: [\"getFreightRates\", \"getShipVia\"],\n nexus: [\n \"createBinTransfer\",\n \"createReceiving\",\n \"createTransfer\",\n \"getPurchaseOrderReceipts\",\n \"getTransferReceipts\",\n \"getTransferShipping\",\n ],\n vmi: [\n \"getWarehouses\",\n \"getWarehouseAvailability\",\n \"getDistributors\",\n \"getProducts\",\n \"getInventoryProfiles\",\n \"getRestockHeaders\",\n \"getSections\",\n ],\n p21Core: [\n \"getAddresses\",\n \"getCompanies\",\n \"getCompany\",\n \"getLocations\",\n \"getPaymentTypes\",\n \"getCashDrawers\",\n \"getCodeP21\",\n ],\n p21Apis: [\n \"getCategories\",\n \"getCategoryDefaults\",\n \"getCompanies\",\n \"getUsers\",\n \"getWebDisplayTypes\",\n \"getWebDisplayTypeDefaults\",\n \"refreshContacts\",\n \"refreshCustomers\",\n ],\n p21Sism: [\"getRecentImports\", \"getImport\", \"getImportLines\", \"getScheduledImports\"],\n agrWork: [\"healthCheck\", \"ping\"],\n agrInfo: [\"getContext\", \"getRubrics\", \"getMicroservices\", \"generateAkasha\", \"generateJoomla\"],\n basecamp2: [\n \"getTodos\",\n \"getTodo\",\n \"getTodosSummary\",\n \"getComments\",\n \"getPeople\",\n \"getProjects\",\n \"getEvents\",\n \"getMetrics\",\n \"getTodolists\",\n ],\n brandFolder: [\"getCategories\", \"getCategory\", \"createFocus\"],\n gregorovich: [\"askChatGpt\", \"getDocuments\", \"createDocument\", \"generateOllama\"],\n slack: [\"sendWebhook\", \"getWebhooks\"],\n favorites: [\"getFavorites\", \"addFavorite\", \"removeFavorite\"],\n wishlists: [\n \"getWishlists\",\n \"createWishlist\",\n \"getWishlistDetail\",\n \"deleteWishlist\",\n \"addWishlistItems\",\n \"removeWishlistItem\",\n ],\n};\n\nfunction createStubFn(): MockFn {\n const calls: unknown[][] = [];\n\n const fn = ((...args: unknown[]) => {\n calls.push(args);\n const impl = (fn as MockFnInternal)._impl;\n return impl ? impl(...args) : undefined;\n }) as MockFn & MockFnInternal;\n\n fn._impl = undefined;\n fn.mock = { calls };\n\n fn.mockResolvedValue = (value: unknown) => {\n fn._impl = () => Promise.resolve(value);\n return fn;\n };\n\n fn.mockRejectedValue = (value: unknown) => {\n fn._impl = () => Promise.reject(value);\n return fn;\n };\n\n fn.mockReturnValue = (value: unknown) => {\n fn._impl = () => value;\n return fn;\n };\n\n fn.mockImplementation = (impl: (...args: unknown[]) => unknown) => {\n fn._impl = impl;\n return fn;\n };\n\n return fn;\n}\n\ninterface MockFnInternal {\n _impl: ((...args: unknown[]) => unknown) | undefined;\n}\n\n/**\n * Creates a fully-mocked SiteActions object for testing.\n *\n * Every method on every service is a stub function with call tracking\n * and `.mockResolvedValue()` / `.mockReturnValue()` support.\n * Works with both Vitest and Jest — no framework dependency.\n *\n * @example\n * ```ts\n * import { createMockSiteActions } from \"@simpleapps-com/augur-server/testing\";\n *\n * const { actions, mocks } = createMockSiteActions();\n *\n * // Setup return values\n * mocks.pricing.getItemPrice.mockResolvedValue({ price: 9.99 });\n *\n * // Pass actions to your component/server action\n * const price = await actions.pricing.getItemPrice(\"ITEM-1\");\n *\n * // Assert calls\n * expect(mocks.pricing.getItemPrice.mock.calls[0]).toEqual([\"ITEM-1\"]);\n * ```\n */\nexport function createMockSiteActions(): MockSiteActionsResult {\n const result: Record<string, Record<string, MockFn>> = {};\n\n for (const [service, methods] of Object.entries(SERVICE_METHODS)) {\n const serviceMock: Record<string, MockFn> = {};\n for (const method of methods) {\n serviceMock[method] = createStubFn();\n }\n result[service] = serviceMock;\n }\n\n return {\n actions: result as unknown as SiteActions,\n mocks: result as unknown as MockSiteActions,\n };\n}\n"],"mappings":"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","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simpleapps-com/augur-server",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"types": "./dist/hooks.d.ts",
|
|
39
39
|
"import": "./dist/hooks.js"
|
|
40
40
|
},
|
|
41
|
+
"./query-action": {
|
|
42
|
+
"types": "./dist/query-action.d.ts",
|
|
43
|
+
"import": "./dist/query-action.js"
|
|
44
|
+
},
|
|
41
45
|
"./next-auth": {
|
|
42
46
|
"types": "./next-auth.d.ts"
|
|
43
47
|
}
|
|
@@ -50,9 +54,9 @@
|
|
|
50
54
|
"llms.txt"
|
|
51
55
|
],
|
|
52
56
|
"dependencies": {
|
|
53
|
-
"@simpleapps-com/augur-core": "2.2.
|
|
54
|
-
"@simpleapps-com/augur-hooks": "2.2.
|
|
55
|
-
"@simpleapps-com/augur-utils": "2.2.
|
|
57
|
+
"@simpleapps-com/augur-core": "2.2.5",
|
|
58
|
+
"@simpleapps-com/augur-hooks": "2.2.5",
|
|
59
|
+
"@simpleapps-com/augur-utils": "2.2.5"
|
|
56
60
|
},
|
|
57
61
|
"peerDependencies": {
|
|
58
62
|
"@simpleapps-com/augur-api": "^2026.3.5",
|
|
@@ -80,7 +84,7 @@
|
|
|
80
84
|
"tsup": "^8.5.0",
|
|
81
85
|
"vitest": "^3.2.0",
|
|
82
86
|
"@augur-packages/tsconfig": "0.0.0",
|
|
83
|
-
"@simpleapps-com/augur-hooks": "2.2.
|
|
87
|
+
"@simpleapps-com/augur-hooks": "2.2.5"
|
|
84
88
|
},
|
|
85
89
|
"scripts": {
|
|
86
90
|
"build": "tsup",
|