@simpleapps-com/augur-server 2026.11.1 → 2026.11.2
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/EXPORTS.md +1 -1
- package/dist/actions/agr-info.d.ts +3 -2
- package/dist/actions/agr-info.d.ts.map +1 -1
- package/dist/actions/agr-site.d.ts +2 -1
- package/dist/actions/agr-site.d.ts.map +1 -1
- package/dist/actions/basecamp2.d.ts +3 -2
- package/dist/actions/basecamp2.d.ts.map +1 -1
- package/dist/actions/brand-folder.d.ts +2 -1
- package/dist/actions/brand-folder.d.ts.map +1 -1
- package/dist/actions/customers.d.ts +2 -1
- package/dist/actions/customers.d.ts.map +1 -1
- package/dist/actions/favorites.d.ts +2 -1
- package/dist/actions/favorites.d.ts.map +1 -1
- package/dist/actions/gregorovich.d.ts +2 -1
- package/dist/actions/gregorovich.d.ts.map +1 -1
- package/dist/actions/items.d.ts +3 -2
- package/dist/actions/items.d.ts.map +1 -1
- package/dist/actions/joomla.d.ts +2 -1
- package/dist/actions/joomla.d.ts.map +1 -1
- package/dist/actions/legacy.d.ts +3 -2
- package/dist/actions/legacy.d.ts.map +1 -1
- package/dist/actions/logistics.d.ts +3 -2
- package/dist/actions/logistics.d.ts.map +1 -1
- package/dist/actions/orders.d.ts +2 -1
- package/dist/actions/orders.d.ts.map +1 -1
- package/dist/actions/p21-apis.d.ts +2 -1
- package/dist/actions/p21-apis.d.ts.map +1 -1
- package/dist/actions/p21-core.d.ts +3 -2
- package/dist/actions/p21-core.d.ts.map +1 -1
- package/dist/actions/p21-pim.d.ts +2 -1
- package/dist/actions/p21-pim.d.ts.map +1 -1
- package/dist/actions/p21-sism.d.ts +2 -1
- package/dist/actions/p21-sism.d.ts.map +1 -1
- package/dist/actions/pricing.d.ts +3 -2
- package/dist/actions/pricing.d.ts.map +1 -1
- package/dist/actions/search.d.ts +2 -1
- package/dist/actions/search.d.ts.map +1 -1
- package/dist/actions/shipping.d.ts +2 -1
- package/dist/actions/shipping.d.ts.map +1 -1
- package/dist/actions/site.d.ts +6 -5
- package/dist/actions/site.d.ts.map +1 -1
- package/dist/actions/vmi.d.ts +3 -2
- package/dist/actions/vmi.d.ts.map +1 -1
- package/dist/actions/wishlists.d.ts +2 -1
- package/dist/actions/wishlists.d.ts.map +1 -1
- package/dist/api.js +3 -3
- package/dist/auth.js +2 -2
- package/dist/cache/redis-client.d.ts +4 -2
- package/dist/cache/redis-client.d.ts.map +1 -1
- package/dist/cache/with-cache.d.ts +9 -10
- package/dist/cache/with-cache.d.ts.map +1 -1
- package/dist/{chunk-U2BKHRJC.js → chunk-6CSVIBHQ.js} +6 -6
- package/dist/chunk-6CSVIBHQ.js.map +1 -0
- package/dist/{chunk-NTUPTNOI.js → chunk-A4IVBK6P.js} +2 -2
- package/dist/{chunk-SXXWBSTX.js → chunk-INVDQQ7T.js} +2 -2
- package/dist/{chunk-PFYEMJTQ.js → chunk-LX7SJJOU.js} +79 -43
- package/dist/chunk-LX7SJJOU.js.map +1 -0
- package/dist/{chunk-TVH5EONP.js → chunk-OBWQSGB6.js} +36 -9
- package/dist/chunk-OBWQSGB6.js.map +1 -0
- package/dist/{chunk-FWO6Q43T.js → chunk-UVGG74FO.js} +3 -3
- package/dist/duration.d.ts +16 -0
- package/dist/duration.d.ts.map +1 -0
- package/dist/hooks.js +3 -3
- package/dist/index.js +4 -4
- package/dist/query-action.js +3 -3
- package/dist/query-options-helper.d.ts +7 -6
- package/dist/query-options-helper.d.ts.map +1 -1
- package/dist/query.js +1 -1
- package/dist/rules.d.ts +17 -8
- package/dist/rules.d.ts.map +1 -1
- package/dist/server-site-registry.d.ts.map +1 -1
- package/dist/server-site.d.ts.map +1 -1
- package/dist/site.js +9 -8
- package/dist/site.js.map +1 -1
- package/dist/testing.js +3 -3
- package/llms.txt +1 -1
- package/package.json +7 -6
- package/dist/chunk-PFYEMJTQ.js.map +0 -1
- package/dist/chunk-TVH5EONP.js.map +0 -1
- package/dist/chunk-U2BKHRJC.js.map +0 -1
- /package/dist/{chunk-NTUPTNOI.js.map → chunk-A4IVBK6P.js.map} +0 -0
- /package/dist/{chunk-SXXWBSTX.js.map → chunk-INVDQQ7T.js.map} +0 -0
- /package/dist/{chunk-FWO6Q43T.js.map → chunk-UVGG74FO.js.map} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AugurAPI } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { Seconds } from "../duration";
|
|
2
3
|
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
3
4
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
4
5
|
export type WishlistsApiClient = Pick<AugurAPI, "items">;
|
|
@@ -8,7 +9,7 @@ export interface WishlistActionsConfig {
|
|
|
8
9
|
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
9
10
|
edgeCache?: EdgeCacheValue;
|
|
10
11
|
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
11
|
-
redisTtl?:
|
|
12
|
+
redisTtl?: Seconds;
|
|
12
13
|
}
|
|
13
14
|
export interface WishlistActions {
|
|
14
15
|
getWishlists: (userId: number) => Promise<ListResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wishlists.d.ts","sourceRoot":"","sources":["../../src/actions/wishlists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"wishlists.d.ts","sourceRoot":"","sources":["../../src/actions/wishlists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACtD,cAAc,EAAE,CACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,KACzC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5E,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,gBAAgB,EAAE,CAChB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,KAC5B,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3F;AAED,sFAAsF;AACtF,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,kBAAkB,EACvB,MAAM,GAAE,qBAA0B,GACjC,eAAe,CAqEjB"}
|
package/dist/api.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
queryAction
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-UVGG74FO.js";
|
|
4
|
+
import "./chunk-A4IVBK6P.js";
|
|
5
5
|
import {
|
|
6
6
|
apiMessageOf,
|
|
7
7
|
apiStatusOf,
|
|
8
8
|
bodyOutcomeOf,
|
|
9
9
|
isCrossOrigin
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OBWQSGB6.js";
|
|
11
11
|
|
|
12
12
|
// src/api-handler.ts
|
|
13
13
|
function refusal(outcome) {
|
package/dist/auth.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import type { CacheKey } from "@simpleapps-com/augur-core";
|
|
2
|
+
import type { Seconds } from "../duration";
|
|
1
3
|
/**
|
|
2
4
|
* Read a cached value by key.
|
|
3
5
|
* Returns `null` on cache miss, circuit-open, connection failure, or if
|
|
4
6
|
* Redis is unavailable. Never throws.
|
|
5
7
|
*/
|
|
6
|
-
export declare function cacheGet(key:
|
|
8
|
+
export declare function cacheGet(key: CacheKey): Promise<string | null>;
|
|
7
9
|
/**
|
|
8
10
|
* Write a value to cache with a TTL. Fire-and-forget semantics: no-ops
|
|
9
11
|
* silently when the circuit is open or Redis is unavailable. Never throws.
|
|
10
12
|
*/
|
|
11
|
-
export declare function cacheSet(key:
|
|
13
|
+
export declare function cacheSet(key: CacheKey, value: string, ttl: Seconds): Promise<void>;
|
|
12
14
|
/** Returns the current circuit breaker state. */
|
|
13
15
|
export declare function getCircuitState(): "closed" | "open";
|
|
14
16
|
/** Whether the Redis client is connected and ready to accept commands. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis-client.d.ts","sourceRoot":"","sources":["../../src/cache/redis-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"redis-client.d.ts","sourceRoot":"","sources":["../../src/cache/redis-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,KAAK,EAAU,OAAO,EAAE,MAAM,aAAa,CAAC;AAgHnD;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAcpE;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAYxF;AAED,iDAAiD;AACjD,wBAAgB,eAAe,IAAI,QAAQ,GAAG,MAAM,CAEnD;AAED,0EAA0E;AAC1E,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
import type { Seconds } from "../duration";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Uses the same cache key format as augur-hooks' client-side caching
|
|
5
|
-
* via augur-core's `buildCacheKey`:
|
|
6
|
-
* `${prefix}sdk:${methodPath}:${fnv1a(stableStringify(keyArgs))}`
|
|
7
|
-
*
|
|
8
|
-
* This means server-side cached data can be read by client-side hooks
|
|
9
|
-
* (and vice versa) when using the same prefix and method path.
|
|
3
|
+
* Caches an action's shaped value.
|
|
10
4
|
*
|
|
11
5
|
* @param prefix Cache key prefix (e.g. "example:"). Empty string if none.
|
|
12
|
-
* @param redisTtl Redis TTL
|
|
6
|
+
* @param redisTtl Redis TTL (`Seconds`, e.g. `hours(1)`). 0 or undefined = skip caching.
|
|
13
7
|
* @param methodPath Dot-separated SDK method path (e.g. "pricing.priceEngine.get").
|
|
14
8
|
* @param fn The async function to cache.
|
|
15
9
|
* @param keyArgs Values to hash for the cache key.
|
|
16
10
|
*/
|
|
17
|
-
export declare function withServerCache<T>(prefix: string, redisTtl:
|
|
11
|
+
export declare function withServerCache<T>(prefix: string, redisTtl: Seconds | undefined, methodPath: string, fn: () => Promise<T>, ...keyArgs: unknown[]): Promise<T>;
|
|
12
|
+
/**
|
|
13
|
+
* Caches a raw SDK result (the envelope as returned), in its own key space: the same
|
|
14
|
+
* parameters as {@link withServerCache}.
|
|
15
|
+
*/
|
|
16
|
+
export declare function withRawSdkCache<T>(prefix: string, redisTtl: Seconds | undefined, methodPath: string, fn: () => Promise<T>, ...keyArgs: unknown[]): Promise<T>;
|
|
18
17
|
//# sourceMappingURL=with-cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-cache.d.ts","sourceRoot":"","sources":["../../src/cache/with-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-cache.d.ts","sourceRoot":"","sources":["../../src/cache/with-cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAqD3C;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,GAAG,OAAO,EAAE,OAAO,EAAE,GACpB,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,GAAG,OAAO,EAAE,OAAO,EAAE,GACpB,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/query-options-helper.ts
|
|
2
|
-
import {
|
|
2
|
+
import { tierBrowserGcTime, tierStaleTime } from "@simpleapps-com/augur-utils";
|
|
3
3
|
import { resolveGcTime } from "@simpleapps-com/augur-core";
|
|
4
4
|
function queryKeyFor(baseKey, params, excludeFromKey) {
|
|
5
5
|
const paramEntries = Object.entries(params).filter(([key, value]) => {
|
|
@@ -13,8 +13,8 @@ var createQueryOptions = ({
|
|
|
13
13
|
params,
|
|
14
14
|
queryFn,
|
|
15
15
|
enabledFn,
|
|
16
|
-
staleTime =
|
|
17
|
-
gcTime =
|
|
16
|
+
staleTime = tierStaleTime("SEMI_STATIC"),
|
|
17
|
+
gcTime = tierBrowserGcTime("SEMI_STATIC"),
|
|
18
18
|
excludeFromKey
|
|
19
19
|
}) => {
|
|
20
20
|
return {
|
|
@@ -29,8 +29,8 @@ var createSuspenseQueryOptions = ({
|
|
|
29
29
|
baseKey,
|
|
30
30
|
params,
|
|
31
31
|
queryFn,
|
|
32
|
-
staleTime =
|
|
33
|
-
gcTime =
|
|
32
|
+
staleTime = tierStaleTime("SEMI_STATIC"),
|
|
33
|
+
gcTime = tierBrowserGcTime("SEMI_STATIC"),
|
|
34
34
|
excludeFromKey
|
|
35
35
|
}) => {
|
|
36
36
|
return {
|
|
@@ -45,4 +45,4 @@ export {
|
|
|
45
45
|
createQueryOptions,
|
|
46
46
|
createSuspenseQueryOptions
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-6CSVIBHQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/query-options-helper.ts"],"sourcesContent":["import type { UseQueryOptions, UseSuspenseQueryOptions } from \"@tanstack/react-query\";\nimport { tierBrowserGcTime, tierStaleTime } from \"@simpleapps-com/augur-utils\";\nimport { resolveGcTime } from \"@simpleapps-com/augur-core\";\nimport type { Millis } from \"./duration\";\n\nexport interface QueryOptionsConfig<TParams, TData> {\n /** Base query key (e.g., \"customer-orders\") */\n baseKey: string;\n /** Parameters object */\n params: TParams;\n /** Function that returns the data */\n queryFn: (params: TParams) => Promise<TData>;\n /** Function to determine if query should be enabled */\n enabledFn?: (params: TParams) => boolean;\n /** Custom stale time (default: SEMI_STATIC's) */\n staleTime?: Millis;\n /**\n * Custom garbage collection time in the browser (default: SEMI_STATIC's). On the server the\n * returned gcTime is always `Infinity` (no GC timer), so the per-request cache is freed with\n * the request (#481).\n */\n gcTime?: Millis;\n /** Key to exclude from query key generation */\n excludeFromKey?: keyof TParams;\n}\n\n/**\n * `[baseKey, \"key:value\", ...]` from the params, sorted, leaving out `excludeFromKey` and\n * any undefined, null or empty-string value.\n */\nfunction queryKeyFor<TParams extends Record<string, unknown>>(\n baseKey: string,\n params: TParams,\n excludeFromKey: keyof TParams | undefined,\n): string[] {\n const paramEntries = Object.entries(params)\n .filter(([key, value]) => {\n if (excludeFromKey && key === excludeFromKey) return false;\n return value !== undefined && value !== null && value !== \"\";\n })\n .map(([key, value]) => `${key}:${value}`)\n .sort();\n\n return [baseKey, ...paramEntries];\n}\n\n/**\n * Creates useQuery options with consistent key generation.\n * Filters out undefined/null/empty params from the query key.\n */\nexport const createQueryOptions = <TParams extends Record<string, unknown>, TData>({\n baseKey,\n params,\n queryFn,\n enabledFn,\n staleTime = tierStaleTime(\"SEMI_STATIC\"),\n gcTime = tierBrowserGcTime(\"SEMI_STATIC\"),\n excludeFromKey,\n}: QueryOptionsConfig<TParams, TData>): UseQueryOptions<TData> => {\n return {\n queryKey: queryKeyFor(baseKey, params, excludeFromKey),\n queryFn: () => queryFn(params),\n enabled: enabledFn ? enabledFn(params) : true,\n staleTime,\n gcTime: resolveGcTime(gcTime),\n };\n};\n\n/**\n * Creates useSuspenseQuery options with consistent key generation.\n * Same as createQueryOptions but without enabledFn (suspense queries\n * cannot be disabled).\n */\nexport const createSuspenseQueryOptions = <TParams extends Record<string, unknown>, TData>({\n baseKey,\n params,\n queryFn,\n staleTime = tierStaleTime(\"SEMI_STATIC\"),\n gcTime = tierBrowserGcTime(\"SEMI_STATIC\"),\n excludeFromKey,\n}: Omit<QueryOptionsConfig<TParams, TData>, \"enabledFn\">): UseSuspenseQueryOptions<TData> => {\n return {\n queryKey: queryKeyFor(baseKey, params, excludeFromKey),\n queryFn: () => queryFn(params),\n staleTime,\n gcTime: resolveGcTime(gcTime),\n };\n};\n"],"mappings":";AACA,SAAS,mBAAmB,qBAAqB;AACjD,SAAS,qBAAqB;AA4B9B,SAAS,YACP,SACA,QACA,gBACU;AACV,QAAM,eAAe,OAAO,QAAQ,MAAM,EACvC,OAAO,CAAC,CAAC,KAAK,KAAK,MAAM;AACxB,QAAI,kBAAkB,QAAQ,eAAgB,QAAO;AACrD,WAAO,UAAU,UAAa,UAAU,QAAQ,UAAU;AAAA,EAC5D,CAAC,EACA,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,EACvC,KAAK;AAER,SAAO,CAAC,SAAS,GAAG,YAAY;AAClC;AAMO,IAAM,qBAAqB,CAAiD;AAAA,EACjF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,cAAc,aAAa;AAAA,EACvC,SAAS,kBAAkB,aAAa;AAAA,EACxC;AACF,MAAkE;AAChE,SAAO;AAAA,IACL,UAAU,YAAY,SAAS,QAAQ,cAAc;AAAA,IACrD,SAAS,MAAM,QAAQ,MAAM;AAAA,IAC7B,SAAS,YAAY,UAAU,MAAM,IAAI;AAAA,IACzC;AAAA,IACA,QAAQ,cAAc,MAAM;AAAA,EAC9B;AACF;AAOO,IAAM,6BAA6B,CAAiD;AAAA,EACzF;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,cAAc,aAAa;AAAA,EACvC,SAAS,kBAAkB,aAAa;AAAA,EACxC;AACF,MAA6F;AAC3F,SAAO;AAAA,IACL,UAAU,YAAY,SAAS,QAAQ,cAAc;AAAA,IACrD,SAAS,MAAM,QAAQ,MAAM;AAAA,IAC7B;AAAA,IACA,QAAQ,cAAc,MAAM;AAAA,EAC9B;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
approvePath,
|
|
3
3
|
slotDecisionOf
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OBWQSGB6.js";
|
|
5
5
|
|
|
6
6
|
// src/scoped-client-key.ts
|
|
7
7
|
var SEPARATOR_CODE = 0;
|
|
@@ -100,4 +100,4 @@ export {
|
|
|
100
100
|
getOrCreateScopedClient,
|
|
101
101
|
parseMethodPath
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
//# sourceMappingURL=chunk-A4IVBK6P.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
verifiedFlag
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OBWQSGB6.js";
|
|
4
4
|
|
|
5
5
|
// src/auth.ts
|
|
6
6
|
import Credentials from "next-auth/providers/credentials";
|
|
@@ -167,4 +167,4 @@ function createAuthConfig(options) {
|
|
|
167
167
|
export {
|
|
168
168
|
createAuthConfig
|
|
169
169
|
};
|
|
170
|
-
//# sourceMappingURL=chunk-
|
|
170
|
+
//# sourceMappingURL=chunk-INVDQQ7T.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerSdkCallWrapper,
|
|
3
3
|
registerSdkClient
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A4IVBK6P.js";
|
|
5
5
|
import {
|
|
6
|
+
cacheTtlOf,
|
|
6
7
|
circuitCheck,
|
|
7
8
|
configuredModeOf,
|
|
8
9
|
docUidOf,
|
|
@@ -19,7 +20,7 @@ import {
|
|
|
19
20
|
shouldCache,
|
|
20
21
|
takesItemId,
|
|
21
22
|
ttlFor
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OBWQSGB6.js";
|
|
23
24
|
|
|
24
25
|
// src/environment.ts
|
|
25
26
|
function getEnvironment() {
|
|
@@ -38,13 +39,14 @@ var isStaging = env === "staging";
|
|
|
38
39
|
var isProduction = env === "production";
|
|
39
40
|
|
|
40
41
|
// src/cache/redis-client.ts
|
|
41
|
-
|
|
42
|
+
import { millis, minutes } from "@simpleapps-com/augur-utils";
|
|
43
|
+
var CIRCUIT_BREAKER_RESET = minutes(1);
|
|
42
44
|
var g = globalThis;
|
|
43
45
|
if (!g.__redisState) {
|
|
44
46
|
g.__redisState = {
|
|
45
47
|
client: null,
|
|
46
48
|
consecutiveFailures: 0,
|
|
47
|
-
circuitOpenUntil: 0
|
|
49
|
+
circuitOpenUntil: millis(0)
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
var state = g.__redisState;
|
|
@@ -63,15 +65,15 @@ function setCircuit(next) {
|
|
|
63
65
|
}
|
|
64
66
|
function isCircuitOpen() {
|
|
65
67
|
const wasOpen = state.circuitOpenUntil !== 0;
|
|
66
|
-
const answer = circuitCheck(circuit(), Date.now());
|
|
68
|
+
const answer = circuitCheck(circuit(), millis(Date.now()));
|
|
67
69
|
setCircuit(answer.next);
|
|
68
70
|
if (wasOpen && !answer.open) log("Circuit breaker reset -- retrying Redis");
|
|
69
71
|
return answer.open;
|
|
70
72
|
}
|
|
71
73
|
function recordFailure() {
|
|
72
|
-
setCircuit(recordFailureOf(circuit(), Date.now()));
|
|
74
|
+
setCircuit(recordFailureOf(circuit(), millis(Date.now())));
|
|
73
75
|
if (opensAt(state.consecutiveFailures)) {
|
|
74
|
-
log(`Circuit breaker OPEN -- skipping Redis for ${
|
|
76
|
+
log(`Circuit breaker OPEN -- skipping Redis for ${CIRCUIT_BREAKER_RESET}s`);
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
function recordSuccess() {
|
|
@@ -125,12 +127,12 @@ async function cacheGet(key) {
|
|
|
125
127
|
return null;
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
|
-
async function cacheSet(key, value,
|
|
130
|
+
async function cacheSet(key, value, ttl) {
|
|
129
131
|
if (isCircuitOpen()) return;
|
|
130
132
|
const client = await getClient();
|
|
131
133
|
if (!client) return;
|
|
132
134
|
try {
|
|
133
|
-
await client.setex(key,
|
|
135
|
+
await client.setex(key, ttl, value);
|
|
134
136
|
recordSuccess();
|
|
135
137
|
} catch {
|
|
136
138
|
recordFailure();
|
|
@@ -185,11 +187,12 @@ async function batchFetch(params, fetchOne, getKey) {
|
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
// src/cache/with-cache.ts
|
|
188
|
-
import { buildCacheKey } from "@simpleapps-com/augur-core";
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
import { buildCacheKey, buildRawCacheKey } from "@simpleapps-com/augur-core";
|
|
191
|
+
import { seconds } from "@simpleapps-com/augur-utils";
|
|
192
|
+
async function readThrough(redisTtl, keyOf, fn) {
|
|
193
|
+
const ttl = cacheTtlOf(redisTtl === void 0 || Number.isNaN(redisTtl), redisTtl ?? seconds(0));
|
|
191
194
|
if (!shouldCache(ttl)) return fn();
|
|
192
|
-
const key =
|
|
195
|
+
const key = keyOf();
|
|
193
196
|
try {
|
|
194
197
|
const cached = await cacheGet(key);
|
|
195
198
|
if (cached != null) return JSON.parse(cached);
|
|
@@ -203,6 +206,12 @@ async function withServerCache(prefix, redisTtl, methodPath, fn, ...keyArgs) {
|
|
|
203
206
|
}
|
|
204
207
|
return result;
|
|
205
208
|
}
|
|
209
|
+
async function withServerCache(prefix, redisTtl, methodPath, fn, ...keyArgs) {
|
|
210
|
+
return readThrough(redisTtl, () => buildCacheKey(prefix, methodPath, keyArgs), fn);
|
|
211
|
+
}
|
|
212
|
+
async function withRawSdkCache(prefix, redisTtl, methodPath, fn, ...keyArgs) {
|
|
213
|
+
return readThrough(redisTtl, () => buildRawCacheKey(prefix, methodPath, keyArgs), fn);
|
|
214
|
+
}
|
|
206
215
|
|
|
207
216
|
// src/pagination.ts
|
|
208
217
|
function paginateOffset(items, pageParam, limit, total) {
|
|
@@ -219,6 +228,7 @@ function paginateOffset(items, pageParam, limit, total) {
|
|
|
219
228
|
import { createActionsProxy } from "@simpleapps-com/augur-core";
|
|
220
229
|
|
|
221
230
|
// src/actions/pricing.ts
|
|
231
|
+
import { hours, minutes as minutes2 } from "@simpleapps-com/augur-utils";
|
|
222
232
|
function resolveCustomerId(explicit, fallback) {
|
|
223
233
|
return positiveOrZero(Number(explicit ?? fallback));
|
|
224
234
|
}
|
|
@@ -227,8 +237,8 @@ function createPricingActions(api, config = {}) {
|
|
|
227
237
|
defaultCustomerId,
|
|
228
238
|
cachePrefix = "",
|
|
229
239
|
edgeCache = 2,
|
|
230
|
-
redisTtl =
|
|
231
|
-
taxRedisTtl =
|
|
240
|
+
redisTtl = hours(1),
|
|
241
|
+
taxRedisTtl = minutes2(30)
|
|
232
242
|
} = config;
|
|
233
243
|
async function getItemPrice(itemId, customerId, quantity = 1) {
|
|
234
244
|
const custId = resolveCustomerId(customerId, defaultCustomerId);
|
|
@@ -274,14 +284,15 @@ function createPricingActions(api, config = {}) {
|
|
|
274
284
|
}
|
|
275
285
|
|
|
276
286
|
// src/actions/items.ts
|
|
287
|
+
import { hours as hours2 } from "@simpleapps-com/augur-utils";
|
|
277
288
|
import { categorySortBy } from "@simpleapps-com/augur-utils";
|
|
278
289
|
function createItemActions(api, config = {}) {
|
|
279
290
|
const {
|
|
280
291
|
cachePrefix = "",
|
|
281
292
|
edgeCache = 1,
|
|
282
293
|
longEdgeCache = 8,
|
|
283
|
-
redisTtl =
|
|
284
|
-
longRedisTtl =
|
|
294
|
+
redisTtl = hours2(1),
|
|
295
|
+
longRedisTtl = hours2(8),
|
|
285
296
|
sortChildren = true,
|
|
286
297
|
sortByPrefix
|
|
287
298
|
} = config;
|
|
@@ -618,11 +629,12 @@ function createCommerceActions(api, config = {}) {
|
|
|
618
629
|
}
|
|
619
630
|
|
|
620
631
|
// src/actions/search.ts
|
|
632
|
+
import { hours as hours3 } from "@simpleapps-com/augur-utils";
|
|
621
633
|
function createSearchActions(api, config = {}) {
|
|
622
634
|
const {
|
|
623
635
|
cachePrefix = "",
|
|
624
636
|
edgeCache = 1,
|
|
625
|
-
redisTtl =
|
|
637
|
+
redisTtl = hours3(1),
|
|
626
638
|
defaultSourceFields = "display_desc"
|
|
627
639
|
} = config;
|
|
628
640
|
const openSearch = api.openSearch;
|
|
@@ -717,8 +729,9 @@ function createSearchActions(api, config = {}) {
|
|
|
717
729
|
}
|
|
718
730
|
|
|
719
731
|
// src/actions/orders.ts
|
|
732
|
+
import { hours as hours4 } from "@simpleapps-com/augur-utils";
|
|
720
733
|
function createOrderActions(api, config = {}) {
|
|
721
|
-
const { cachePrefix = "", edgeCache = 1, redisTtl =
|
|
734
|
+
const { cachePrefix = "", edgeCache = 1, redisTtl = hours4(1) } = config;
|
|
722
735
|
async function getOrderDoc(orderNo, postalCode) {
|
|
723
736
|
return withServerCache(
|
|
724
737
|
cachePrefix,
|
|
@@ -739,13 +752,14 @@ function createOrderActions(api, config = {}) {
|
|
|
739
752
|
}
|
|
740
753
|
|
|
741
754
|
// src/actions/shipping.ts
|
|
755
|
+
import { hours as hours5 } from "@simpleapps-com/augur-utils";
|
|
742
756
|
function createShippingActions(api, config) {
|
|
743
757
|
const {
|
|
744
758
|
fromAddress,
|
|
745
759
|
defaultServiceCodes,
|
|
746
760
|
cachePrefix = "",
|
|
747
761
|
edgeCache = 1,
|
|
748
|
-
redisTtl =
|
|
762
|
+
redisTtl = hours5(1)
|
|
749
763
|
} = config;
|
|
750
764
|
async function getShippingRates(toAddress, weight, serviceCodes) {
|
|
751
765
|
const params = {
|
|
@@ -778,8 +792,9 @@ function createShippingActions(api, config) {
|
|
|
778
792
|
}
|
|
779
793
|
|
|
780
794
|
// src/actions/joomla.ts
|
|
795
|
+
import { hours as hours6 } from "@simpleapps-com/augur-utils";
|
|
781
796
|
function createJoomlaActions(api, config = {}) {
|
|
782
|
-
const { cachePrefix = "", edgeCache = 1, redisTtl =
|
|
797
|
+
const { cachePrefix = "", edgeCache = 1, redisTtl = hours6(1) } = config;
|
|
783
798
|
async function getJoomlaContent(articleId, options) {
|
|
784
799
|
if (options?.alias) {
|
|
785
800
|
return withServerCache(
|
|
@@ -919,13 +934,14 @@ function createJoomlaActions(api, config = {}) {
|
|
|
919
934
|
}
|
|
920
935
|
|
|
921
936
|
// src/actions/legacy.ts
|
|
937
|
+
import { hours as hours7 } from "@simpleapps-com/augur-utils";
|
|
922
938
|
function createLegacyActions(api, config = {}) {
|
|
923
939
|
const {
|
|
924
940
|
cachePrefix = "",
|
|
925
941
|
edgeCache = 1,
|
|
926
942
|
longEdgeCache = 8,
|
|
927
|
-
redisTtl =
|
|
928
|
-
longRedisTtl =
|
|
943
|
+
redisTtl = hours7(1),
|
|
944
|
+
longRedisTtl = hours7(8)
|
|
929
945
|
} = config;
|
|
930
946
|
async function getItemWebDesc(invMastUid) {
|
|
931
947
|
return withServerCache(
|
|
@@ -991,8 +1007,9 @@ function createLegacyActions(api, config = {}) {
|
|
|
991
1007
|
}
|
|
992
1008
|
|
|
993
1009
|
// src/actions/customers.ts
|
|
1010
|
+
import { hours as hours8 } from "@simpleapps-com/augur-utils";
|
|
994
1011
|
function createCustomersActions(api, config = {}) {
|
|
995
|
-
const { cachePrefix = "", edgeCache = 1, redisTtl =
|
|
1012
|
+
const { cachePrefix = "", edgeCache = 1, redisTtl = hours8(1) } = config;
|
|
996
1013
|
async function customerLookup(params) {
|
|
997
1014
|
return withServerCache(
|
|
998
1015
|
cachePrefix,
|
|
@@ -1163,8 +1180,9 @@ function createSmartyStreetsActions(api, _config = {}) {
|
|
|
1163
1180
|
}
|
|
1164
1181
|
|
|
1165
1182
|
// src/actions/p21-pim.ts
|
|
1183
|
+
import { hours as hours9 } from "@simpleapps-com/augur-utils";
|
|
1166
1184
|
function createP21PimActions(api, config = {}) {
|
|
1167
|
-
const { cachePrefix = "", edgeCache = 1, redisTtl =
|
|
1185
|
+
const { cachePrefix = "", edgeCache = 1, redisTtl = hours9(1) } = config;
|
|
1168
1186
|
async function getInvMastExt(invMastUid) {
|
|
1169
1187
|
return withServerCache(
|
|
1170
1188
|
cachePrefix,
|
|
@@ -1199,8 +1217,9 @@ function createP21PimActions(api, config = {}) {
|
|
|
1199
1217
|
}
|
|
1200
1218
|
|
|
1201
1219
|
// src/actions/agr-site.ts
|
|
1220
|
+
import { hours as hours10 } from "@simpleapps-com/augur-utils";
|
|
1202
1221
|
function createAgrSiteActions(api, config = {}) {
|
|
1203
|
-
const { cachePrefix = "", longEdgeCache = 8, longRedisTtl =
|
|
1222
|
+
const { cachePrefix = "", longEdgeCache = 8, longRedisTtl = hours10(8) } = config;
|
|
1204
1223
|
async function getSettings(serviceName) {
|
|
1205
1224
|
return withServerCache(
|
|
1206
1225
|
cachePrefix,
|
|
@@ -1304,8 +1323,9 @@ function createPaymentsActions(api, config = {}) {
|
|
|
1304
1323
|
}
|
|
1305
1324
|
|
|
1306
1325
|
// src/actions/logistics.ts
|
|
1326
|
+
import { hours as hours11 } from "@simpleapps-com/augur-utils";
|
|
1307
1327
|
function createLogisticsActions(api, config = {}) {
|
|
1308
|
-
const { cachePrefix = "", longEdgeCache = 8, longRedisTtl =
|
|
1328
|
+
const { cachePrefix = "", longEdgeCache = 8, longRedisTtl = hours11(8) } = config;
|
|
1309
1329
|
async function getFreightRates(params) {
|
|
1310
1330
|
try {
|
|
1311
1331
|
const response = await api.logistics.speedship.freight.list(params);
|
|
@@ -1336,8 +1356,14 @@ function createLogisticsActions(api, config = {}) {
|
|
|
1336
1356
|
}
|
|
1337
1357
|
|
|
1338
1358
|
// src/actions/vmi.ts
|
|
1359
|
+
import { hours as hours12, minutes as minutes3 } from "@simpleapps-com/augur-utils";
|
|
1339
1360
|
function createVmiActions(api, config = {}) {
|
|
1340
|
-
const {
|
|
1361
|
+
const {
|
|
1362
|
+
cachePrefix = "",
|
|
1363
|
+
edgeCache = 1,
|
|
1364
|
+
redisTtl = hours12(1),
|
|
1365
|
+
shortRedisTtl = minutes3(5)
|
|
1366
|
+
} = config;
|
|
1341
1367
|
async function getWarehouses(params) {
|
|
1342
1368
|
return withServerCache(
|
|
1343
1369
|
cachePrefix,
|
|
@@ -1438,13 +1464,14 @@ function createVmiActions(api, config = {}) {
|
|
|
1438
1464
|
}
|
|
1439
1465
|
|
|
1440
1466
|
// src/actions/p21-core.ts
|
|
1467
|
+
import { hours as hours13 } from "@simpleapps-com/augur-utils";
|
|
1441
1468
|
function createP21CoreActions(api, config = {}) {
|
|
1442
1469
|
const {
|
|
1443
1470
|
cachePrefix = "",
|
|
1444
1471
|
edgeCache = 1,
|
|
1445
1472
|
longEdgeCache = 8,
|
|
1446
|
-
redisTtl =
|
|
1447
|
-
longRedisTtl =
|
|
1473
|
+
redisTtl = hours13(1),
|
|
1474
|
+
longRedisTtl = hours13(8)
|
|
1448
1475
|
} = config;
|
|
1449
1476
|
async function getAddresses(params) {
|
|
1450
1477
|
return withServerCache(
|
|
@@ -1586,8 +1613,9 @@ function createP21ApisActions(api, _config = {}) {
|
|
|
1586
1613
|
}
|
|
1587
1614
|
|
|
1588
1615
|
// src/actions/p21-sism.ts
|
|
1616
|
+
import { hours as hours14 } from "@simpleapps-com/augur-utils";
|
|
1589
1617
|
function createP21SismActions(api, config = {}) {
|
|
1590
|
-
const { cachePrefix = "", edgeCache = 1, redisTtl =
|
|
1618
|
+
const { cachePrefix = "", edgeCache = 1, redisTtl = hours14(1) } = config;
|
|
1591
1619
|
async function getRecentImports(params) {
|
|
1592
1620
|
return withServerCache(
|
|
1593
1621
|
cachePrefix,
|
|
@@ -1662,13 +1690,14 @@ function createAgrWorkActions(api, _config = {}) {
|
|
|
1662
1690
|
}
|
|
1663
1691
|
|
|
1664
1692
|
// src/actions/agr-info.ts
|
|
1693
|
+
import { hours as hours15 } from "@simpleapps-com/augur-utils";
|
|
1665
1694
|
function createAgrInfoActions(api, config = {}) {
|
|
1666
1695
|
const {
|
|
1667
1696
|
cachePrefix = "",
|
|
1668
1697
|
edgeCache = 1,
|
|
1669
1698
|
longEdgeCache = 8,
|
|
1670
|
-
redisTtl =
|
|
1671
|
-
longRedisTtl =
|
|
1699
|
+
redisTtl = hours15(1),
|
|
1700
|
+
longRedisTtl = hours15(8)
|
|
1672
1701
|
} = config;
|
|
1673
1702
|
async function getContext(params) {
|
|
1674
1703
|
return withServerCache(
|
|
@@ -1742,13 +1771,14 @@ function createAgrInfoActions(api, config = {}) {
|
|
|
1742
1771
|
}
|
|
1743
1772
|
|
|
1744
1773
|
// src/actions/basecamp2.ts
|
|
1774
|
+
import { hours as hours16 } from "@simpleapps-com/augur-utils";
|
|
1745
1775
|
function createBasecamp2Actions(api, config = {}) {
|
|
1746
1776
|
const {
|
|
1747
1777
|
cachePrefix = "",
|
|
1748
1778
|
edgeCache = 1,
|
|
1749
1779
|
longEdgeCache = 8,
|
|
1750
|
-
redisTtl =
|
|
1751
|
-
longRedisTtl =
|
|
1780
|
+
redisTtl = hours16(1),
|
|
1781
|
+
longRedisTtl = hours16(8)
|
|
1752
1782
|
} = config;
|
|
1753
1783
|
async function getTodos(params) {
|
|
1754
1784
|
return withServerCache(
|
|
@@ -1875,8 +1905,9 @@ function createBasecamp2Actions(api, config = {}) {
|
|
|
1875
1905
|
}
|
|
1876
1906
|
|
|
1877
1907
|
// src/actions/brand-folder.ts
|
|
1908
|
+
import { hours as hours17 } from "@simpleapps-com/augur-utils";
|
|
1878
1909
|
function createBrandFolderActions(api, config = {}) {
|
|
1879
|
-
const { cachePrefix = "", edgeCache = 1, redisTtl =
|
|
1910
|
+
const { cachePrefix = "", edgeCache = 1, redisTtl = hours17(1) } = config;
|
|
1880
1911
|
async function getCategories(params) {
|
|
1881
1912
|
return withServerCache(
|
|
1882
1913
|
cachePrefix,
|
|
@@ -1925,8 +1956,9 @@ function createBrandFolderActions(api, config = {}) {
|
|
|
1925
1956
|
}
|
|
1926
1957
|
|
|
1927
1958
|
// src/actions/gregorovich.ts
|
|
1959
|
+
import { hours as hours18 } from "@simpleapps-com/augur-utils";
|
|
1928
1960
|
function createGregorovichActions(api, config = {}) {
|
|
1929
|
-
const { cachePrefix = "", redisTtl =
|
|
1961
|
+
const { cachePrefix = "", redisTtl = hours18(1) } = config;
|
|
1930
1962
|
async function getDocuments(_params) {
|
|
1931
1963
|
return withServerCache(cachePrefix, redisTtl, "gregorovich.documents.list", async () => {
|
|
1932
1964
|
const response = await api.gregorovich.documents.list();
|
|
@@ -1937,8 +1969,9 @@ function createGregorovichActions(api, config = {}) {
|
|
|
1937
1969
|
}
|
|
1938
1970
|
|
|
1939
1971
|
// src/actions/favorites.ts
|
|
1972
|
+
import { hours as hours19 } from "@simpleapps-com/augur-utils";
|
|
1940
1973
|
function createFavoritesActions(api, config = {}) {
|
|
1941
|
-
const { cachePrefix = "", edgeCache = 1, redisTtl =
|
|
1974
|
+
const { cachePrefix = "", edgeCache = 1, redisTtl = hours19(1) } = config;
|
|
1942
1975
|
async function getFavorites(userId) {
|
|
1943
1976
|
return withServerCache(
|
|
1944
1977
|
cachePrefix,
|
|
@@ -1964,8 +1997,9 @@ function createFavoritesActions(api, config = {}) {
|
|
|
1964
1997
|
}
|
|
1965
1998
|
|
|
1966
1999
|
// src/actions/wishlists.ts
|
|
2000
|
+
import { hours as hours20 } from "@simpleapps-com/augur-utils";
|
|
1967
2001
|
function createWishlistActions(api, config = {}) {
|
|
1968
|
-
const { cachePrefix = "", edgeCache = 1, redisTtl =
|
|
2002
|
+
const { cachePrefix = "", edgeCache = 1, redisTtl = hours20(1) } = config;
|
|
1969
2003
|
async function getWishlists(userId) {
|
|
1970
2004
|
return withServerCache(
|
|
1971
2005
|
cachePrefix,
|
|
@@ -2191,7 +2225,7 @@ function createSiteActions(api, config = {}) {
|
|
|
2191
2225
|
cachePrefix,
|
|
2192
2226
|
wrapCall: async ({ methodPath, args, sdkCall: sdkCall2, tier, isRead: read }) => {
|
|
2193
2227
|
if (read && tier.redisTtl) {
|
|
2194
|
-
return
|
|
2228
|
+
return withRawSdkCache(
|
|
2195
2229
|
cachePrefix,
|
|
2196
2230
|
tier.redisTtl,
|
|
2197
2231
|
methodPath,
|
|
@@ -2252,6 +2286,7 @@ function clearSiteActions() {
|
|
|
2252
2286
|
|
|
2253
2287
|
// src/server-site-registry.ts
|
|
2254
2288
|
import { getCacheTier } from "@simpleapps-com/augur-core";
|
|
2289
|
+
import { hours as hours21 } from "@simpleapps-com/augur-utils";
|
|
2255
2290
|
import { AugurAPI } from "@simpleapps-com/augur-api";
|
|
2256
2291
|
function registerSiteActions2(actions) {
|
|
2257
2292
|
registerSiteActions(actions);
|
|
@@ -2259,9 +2294,9 @@ function registerSiteActions2(actions) {
|
|
|
2259
2294
|
function registerClientAndWrapper(api) {
|
|
2260
2295
|
registerSdkClient(api);
|
|
2261
2296
|
registerSdkCallWrapper((methodPath, sdkCall2, ...keyArgs) => {
|
|
2262
|
-
const ttl = ttlFor(getCacheTier(methodPath).staleTime,
|
|
2297
|
+
const ttl = ttlFor(getCacheTier(methodPath).staleTime, hours21(1), hours21(8));
|
|
2263
2298
|
if (ttl === null) return sdkCall2();
|
|
2264
|
-
return
|
|
2299
|
+
return withRawSdkCache("", ttl, methodPath, sdkCall2, ...keyArgs);
|
|
2265
2300
|
});
|
|
2266
2301
|
}
|
|
2267
2302
|
function autoInitFromEnv() {
|
|
@@ -2302,10 +2337,11 @@ export {
|
|
|
2302
2337
|
unwrapOr,
|
|
2303
2338
|
batchFetch,
|
|
2304
2339
|
withServerCache,
|
|
2340
|
+
withRawSdkCache,
|
|
2305
2341
|
paginateOffset,
|
|
2306
2342
|
createSiteActions,
|
|
2307
2343
|
registerSiteActions2 as registerSiteActions,
|
|
2308
2344
|
getSiteActions,
|
|
2309
2345
|
clearSiteActions2 as clearSiteActions
|
|
2310
2346
|
};
|
|
2311
|
-
//# sourceMappingURL=chunk-
|
|
2347
|
+
//# sourceMappingURL=chunk-LX7SJJOU.js.map
|