@simpleapps-com/augur-server 2026.11.5 → 2026.11.7

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.
Files changed (81) hide show
  1. package/EXPORTS.md +26 -1
  2. package/README.md +33 -2
  3. package/dist/actions/action-rules.d.ts +99 -0
  4. package/dist/actions/action-rules.d.ts.map +1 -0
  5. package/dist/actions/agr-site.d.ts +7 -15
  6. package/dist/actions/agr-site.d.ts.map +1 -1
  7. package/dist/actions/commerce.d.ts.map +1 -1
  8. package/dist/actions/customers.d.ts +12 -15
  9. package/dist/actions/customers.d.ts.map +1 -1
  10. package/dist/actions/favorites.d.ts +9 -12
  11. package/dist/actions/favorites.d.ts.map +1 -1
  12. package/dist/actions/gregorovich.d.ts +7 -15
  13. package/dist/actions/gregorovich.d.ts.map +1 -1
  14. package/dist/actions/items.d.ts +8 -20
  15. package/dist/actions/items.d.ts.map +1 -1
  16. package/dist/actions/joomla.d.ts +8 -14
  17. package/dist/actions/joomla.d.ts.map +1 -1
  18. package/dist/actions/legacy.d.ts +10 -20
  19. package/dist/actions/legacy.d.ts.map +1 -1
  20. package/dist/actions/orders.d.ts +7 -14
  21. package/dist/actions/orders.d.ts.map +1 -1
  22. package/dist/actions/read-specs.d.ts +119 -0
  23. package/dist/actions/read-specs.d.ts.map +1 -0
  24. package/dist/actions/site.d.ts.map +1 -1
  25. package/dist/actions/vmi.d.ts +10 -16
  26. package/dist/actions/vmi.d.ts.map +1 -1
  27. package/dist/actions/wishlists.d.ts +11 -13
  28. package/dist/actions/wishlists.d.ts.map +1 -1
  29. package/dist/api-handler.d.ts.map +1 -1
  30. package/dist/api.js +3 -2
  31. package/dist/api.js.map +1 -1
  32. package/dist/auth.js +3 -2
  33. package/dist/cache/redis-client.d.ts.map +1 -1
  34. package/dist/cache/redis-rules.d.ts +21 -0
  35. package/dist/cache/redis-rules.d.ts.map +1 -0
  36. package/dist/cache/spec-read.d.ts +39 -0
  37. package/dist/cache/spec-read.d.ts.map +1 -0
  38. package/dist/cache/with-cache.d.ts +2 -2
  39. package/dist/cache/with-cache.d.ts.map +1 -1
  40. package/dist/{chunk-KSGH4DXD.js → chunk-4JPJQHT6.js} +2 -2
  41. package/dist/{chunk-FIM6LDMD.js → chunk-GJHQPBK7.js} +5 -3
  42. package/dist/chunk-GJHQPBK7.js.map +1 -0
  43. package/dist/chunk-JIYVQWXK.js +10 -0
  44. package/dist/chunk-JIYVQWXK.js.map +1 -0
  45. package/dist/{chunk-U54IM6FL.js → chunk-SFXO74RC.js} +874 -719
  46. package/dist/chunk-SFXO74RC.js.map +1 -0
  47. package/dist/chunk-V76GZZF3.js +66 -0
  48. package/dist/chunk-V76GZZF3.js.map +1 -0
  49. package/dist/{chunk-6GPKXGPG.js → chunk-Z53NEFEQ.js} +8 -16
  50. package/dist/chunk-Z53NEFEQ.js.map +1 -0
  51. package/dist/hooks.d.ts +2 -2
  52. package/dist/hooks.d.ts.map +1 -1
  53. package/dist/hooks.js +5 -3
  54. package/dist/hooks.js.map +1 -1
  55. package/dist/index.js +4 -2
  56. package/dist/index.js.map +1 -1
  57. package/dist/query-action.d.ts +11 -4
  58. package/dist/query-action.d.ts.map +1 -1
  59. package/dist/query-action.js +3 -2
  60. package/dist/read-rules.d.ts +45 -0
  61. package/dist/read-rules.d.ts.map +1 -0
  62. package/dist/server-site-registry.d.ts.map +1 -1
  63. package/dist/server-site.d.ts.map +1 -1
  64. package/dist/site.js +24 -14
  65. package/dist/site.js.map +1 -1
  66. package/dist/sitemap-rules.d.ts +154 -0
  67. package/dist/sitemap-rules.d.ts.map +1 -0
  68. package/dist/sitemap.d.ts +80 -0
  69. package/dist/sitemap.d.ts.map +1 -0
  70. package/dist/sitemap.js +242 -0
  71. package/dist/sitemap.js.map +1 -0
  72. package/dist/testing.js +4 -2
  73. package/dist/testing.js.map +1 -1
  74. package/dist/utils/read-all-pages.d.ts +17 -0
  75. package/dist/utils/read-all-pages.d.ts.map +1 -0
  76. package/llms.txt +44 -1
  77. package/package.json +9 -5
  78. package/dist/chunk-6GPKXGPG.js.map +0 -1
  79. package/dist/chunk-FIM6LDMD.js.map +0 -1
  80. package/dist/chunk-U54IM6FL.js.map +0 -1
  81. /package/dist/{chunk-KSGH4DXD.js.map → chunk-4JPJQHT6.js.map} +0 -0
package/EXPORTS.md CHANGED
@@ -31,7 +31,7 @@
31
31
  | `unwrap` | value | |
32
32
  | `unwrapOr` | value | |
33
33
  | `verifyRecaptcha` | function | Server-side Google reCAPTCHA v3 verification. Used by API routes that accept public form submissions. |
34
- | `withServerCache` | function | Caches an action's shaped value. |
34
+ | `withServerCache` | const | Caches an action's shaped value. |
35
35
 
36
36
  ### Types
37
37
 
@@ -129,6 +129,31 @@
129
129
  |--------|------|-------------|
130
130
  | `createAugurApiHandler` | function | Creates a Next.js Route Handler that routes method calls through queryAction, or through queryActionRaw when the body has `raw: true` (augur-core's `createFetchQueryActionRaw`). |
131
131
 
132
+ ## `@simpleapps-com/augur-server/sitemap`
133
+
134
+ ### Values
135
+
136
+ | Export | Kind | Description |
137
+ |--------|------|-------------|
138
+ | `buildSitemapIndexXml` | function | The item index: a `<sitemapindex>` of `{base}sitemap-1.xml` … `{base}sitemap-{count}.xml`. |
139
+ | `buildUrlsetXml` | function | An item page: a `<urlset>` of the rows under the items' folder, in order. |
140
+ | `createItemSitemapHandler` | function | An item page's Route Handler, for `app/items/sitemap.xml/[page]/route.ts`, which `sitemapRewrite` maps `{base}sitemap-{n}.xml` onto: a `<urlset>` of page n's items under `base`, a 404 for no such page, or a 503 when Augur can't be read. |
141
+ | `createSitemapIndexHandler` | function | The item index's Route Handler, for `app/items/sitemap.xml/route.ts` (or the folder `base` names): a `<sitemapindex>` of every item page file, or a 503 when Augur can't be read. |
142
+ | `DEFAULT_SITEMAP_BASE` | const | The items' folder when a site names none. |
143
+ | `DEFAULT_SITEMAP_DEADLINE` | const | How long one Augur call may take, in milliseconds: crawlers wait longer than page visitors, and a call past it is a 503 the crawler retries. |
144
+ | `inScope` | function | Whether a link is under the items' folder (the location rule); an empty link never is. |
145
+ | `isSitemapPath` | function | Whether a path is one of the item sitemaps (the index or a page file), which a site's proxy MUST pass through before any item-URL redirect (the proxy runs before rewrites). |
146
+ | `itemSitemapCount` | function | How many 5,000-item sitemaps cover `total` items (the endpoint fixes a page at 5,000). |
147
+ | `itemSitemapUrl` | function | Item sitemap n's URL: `{siteUrl}{base}sitemap-{n}.xml`. |
148
+ | `parseItemSitemapPage` | function | The page a request names (the rewrite's bare `:page`): its value when it is a canonical natural number, else 0, "not a page" (`0`, `01`, `1e3`, ` 1`, `-1` and text never name one). |
149
+ | `robotsSitemaps` | function | robots.txt's sitemaps: the site's own root `/sitemap.xml` and the item index. Two lines, since the specs name no index inside an index. |
150
+ | `sitemapBase` | function | The items' folder as a path, with one leading and one trailing "/" ("items" → "/items/"). |
151
+ | `sitemapRewrite` | function | The Next.js rewrite from `{base}sitemap-{n}.xml` to the item page handler's route; spread it into `next.config`'s `rewrites()`. |
152
+
153
+ ### Types
154
+
155
+ `SitemapOptions`, `SitemapOutcome`, `SitemapRewrite`, `SitemapRow`, `SitemapSite`
156
+
132
157
  ## `@simpleapps-com/augur-server/next-auth`
133
158
 
134
159
  No exports.
package/README.md CHANGED
@@ -22,6 +22,7 @@ pnpm add @simpleapps-com/augur-server
22
22
  | `@simpleapps-com/augur-server/hooks` | `createServerQueryProxy` (registers `queryAction`) |
23
23
  | `@simpleapps-com/augur-server/query-action` | `queryAction`, `queryActionRaw`, `queryActionWith`, `queryActionRawWith` (bounded by a deadline or signal, atlas#106), `getSessionCredentials` |
24
24
  | `@simpleapps-com/augur-server/api` | `createAugurApiHandler` (fetch mode) |
25
+ | `@simpleapps-com/augur-server/sitemap` | `createSitemapIndexHandler`, `createItemSitemapHandler`, `sitemapRewrite`, `robotsSitemaps`, `isSitemapPath` (item sitemaps, atlas#101) |
25
26
  | `@simpleapps-com/augur-server/auth` | `createAuthConfig` |
26
27
  | `@simpleapps-com/augur-server/query` | `createQueryOptions`, `createSuspenseQueryOptions` |
27
28
  | `@simpleapps-com/augur-server/actions` | Types only |
@@ -42,11 +43,41 @@ cancels it too (server code only: a signal can't cross a server action from the
42
43
  options never enter the cache key. It needs an `@simpleapps-com/augur-api` with
43
44
  `AugurAPI.withRequest`; on an older client the call is refused rather than run unbounded.
44
45
 
46
+ **Typed by path** (atlas#103): `queryAction` and `queryActionWith` take one of the SDK's method
47
+ paths, that method's own arguments, and return its `data` type (augur-core `MethodPath`,
48
+ `MethodArgs`, `MethodData`; model `models/AugurQueryTypes.dfy`), so an unknown path or arguments
49
+ that no longer match an upgraded SDK fail `tsc` instead of a live request, and `as` casts on the
50
+ result can go. **On upgrade a site may see new type errors: they are real bugs** (calls the SDK
51
+ would refuse). Pass one literal path per call: a union of paths is typed loosely. A path built at
52
+ runtime has no literal type: cast the path, `queryAction(path as MethodPath<AugurAPI>, ...args)`
53
+ (augur-core `MethodPath`; its arguments are then `unknown[]` and its result `unknown`), as
54
+ `createAugurApiHandler` does; the allowlist still checks it. `createAugurOptions(queryAction)`, `registerQueryAction` and
55
+ `createServerQueryProxy` accept it as before (`AnyQueryAction`), and `vi.mocked(queryAction)`
56
+ keeps its untyped signature. `queryActionRaw` / `queryActionRawWith` keep their caller-named `T`.
57
+
58
+ **Reads** (atlas#102): every site-action read follows a read spec (`src/actions/read-specs.ts`).
59
+
60
+ - **Paging:** a read that returns every row pages 100 rows a call until an empty page, at most 50 calls, and returns `{ data, total, capReached }` (so `getWishlistDetail` no longer returns a bare array). `capReached` is true when the cap stopped it: the result may be incomplete.
61
+ - **User data** (`items.itemWishlist`, `items.itemFavorites`) is never cached on the server. In the browser it is cached for a minute and cleared by the user's own writes (augur-hooks `userWriteClearing`).
62
+ - **P21 data** (`customers.customer`, `joomla.users`, `orders.oeHdr`, `vmi`) stays in Redis for a minute and is never cached at the edge.
63
+ - **Guide:** https://augur.build/docs/packages/augur-server.
64
+
65
+ **Item sitemaps** (atlas#101) are built per request from `googMc.sitemaps.items.list`.
66
+
67
+ - **Layout:** the item index is `{base}sitemap.xml` and page n is `{base}sitemap-{n}.xml` (5,000 items each). `base` defaults to `/items/`.
68
+ - **Routes:** `app/items/sitemap.xml/route.ts` and `app/items/sitemap.xml/[page]/route.ts`, plus `sitemapRewrite()` in `next.config`.
69
+ - **`base`** MUST match the item links Augur returns: the protocol lets a sitemap list only URLs under its own folder, and a link outside it is left out.
70
+ - **robots.txt** names the site's root `/sitemap.xml` and the item index (`robotsSitemaps`). The root sitemap stays the site's own.
71
+ - **Item-URL proxies** MUST let `isSitemapPath(pathname)` through before any item-URL redirect.
72
+ - **Failures:** Augur failing or taking longer than `deadline` (10 s by default) answers 503 with `Retry-After`, uncached.
73
+ - **Guide:** https://augur.build/docs/packages/augur-server#item-sitemaps.
74
+
45
75
  ## Development
46
76
 
47
77
  TypeScript in `src/`, built to `dist/` (ESM) by tsup with `"use server"` and `"use client"`
48
- banners per entry. The decisions are proved (`src/rules.ts`, `src/scoped-client-key.ts`; model
49
- `models/AugurServer.dfy`, links `models/links/augur-server-*.dfy`); the rest is tested at 100%.
78
+ banners per entry. The decisions are proved (`src/rules.ts`, `src/scoped-client-key.ts`, `src/sitemap-rules.ts`;
79
+ models `models/AugurServer.dfy`, `models/AugurServerSitemap.dfy`, links
80
+ `models/links/augur-server-*.dfy`); the rest is tested at 100%.
50
81
 
51
82
  ```bash
52
83
  pnpm -C repo/packages/augur-server test
@@ -0,0 +1,99 @@
1
+ /** A category child's display order, and where it sits in the list it came from. */
2
+ export interface SeqEntry {
3
+ seqNo: number;
4
+ index: number;
5
+ }
6
+ /**
7
+ * The entries from `k` on, in display order (an insertion sort, stable).
8
+ *
9
+ * @ensures every entry kept — exactly the model's SortBySeq in the link (sorted, same multiset)
10
+ */
11
+ export declare function sortBySeqFrom(xs: SeqEntry[], k: number): SeqEntry[];
12
+ /** The category's children as shown: in display order, or as given when sorting is off. */
13
+ export declare function categoryChildren(sortChildren: boolean, xs: SeqEntry[]): SeqEntry[];
14
+ /** The first value given: the call's when present, else the fallback. */
15
+ export declare function firstGiven(given: number | undefined, fallback: number | undefined): number | undefined;
16
+ /**
17
+ * A text given, else the fallback (`given ?? fallback`): each category param is the filters'
18
+ * value or its default (model `CategoryParamsByField`).
19
+ *
20
+ * @ensures exactly the model's TextOr
21
+ */
22
+ export declare function textOr(given: string | undefined, fallback: string): string;
23
+ /** getCategoryItems' argument: typed items filters, a raw object with a text sortBy, or raw. */
24
+ export type CategoryArgKind = "typedFilters" | "rawPrefixed" | "rawAsGiven";
25
+ /**
26
+ * Which argument getCategoryItems was given: typed filters (their `filters` an array), else a raw
27
+ * params object, sent with the prefix on its sortBy when that is text, else as given.
28
+ *
29
+ * @ensures exactly the model's CategoryArgKindOf
30
+ */
31
+ export declare function categoryArgKind(filtersIsArray: boolean, sortByIsString: boolean): CategoryArgKind;
32
+ /** getCategoryItemsInfinite: a missing or NaN limit is none. */
33
+ export declare function givenLimit(given: number | undefined, isNan: boolean): number | undefined;
34
+ /** `total || 0`: a missing or NaN total is 0. */
35
+ export declare function totalOrZero(total: number | undefined, isNan: boolean): number;
36
+ /** getInvMastDoc's item id: upper-cased (ASCII, utils' rule) and trimmed. */
37
+ export declare function docItemId(itemId: string): string;
38
+ /**
39
+ * The item id getInvMastDoc sends: an itemId is always upper-case in this system (owner
40
+ * 2026-11-10), so a taken one (positional at uid 0, or any in a params object) is sent as
41
+ * `docItemId` gives it, never as given; else none.
42
+ *
43
+ * @ensures exactly the model's SentItemId
44
+ */
45
+ export declare function sentItemId(itemId: string | undefined, taken: boolean): string | undefined;
46
+ /** batchGetInvMastDocs' key: the item id when given, else the uid as decimal text. */
47
+ export declare function docBatchKey(itemId: string | undefined, uid: number): string;
48
+ /** cartHdrLookup goes ahead only with both a contact and a customer (from the call or config). */
49
+ export declare function cartIdsPresent(hasContact: boolean, hasCustomer: boolean): boolean;
50
+ /** `Number(userId) || 0`: NaN is the anonymous cart (0). */
51
+ export declare function cartUserId(n: number, isNan: boolean): number;
52
+ /** A line's unit of measure: the site's conversion when it has one, else as given. */
53
+ export declare function lineUom(converted: string | undefined, uom: string): string;
54
+ /** getJoomlaContent reads by alias when one is given. */
55
+ export declare function contentByAlias(alias: string): boolean;
56
+ /** The category id is sent only when truthy: 0 and missing are dropped. */
57
+ export declare function catIdParam(catId: number | undefined): number | undefined;
58
+ /** A menu item's parent, and where it sits in the list it came from. */
59
+ export interface ParentEntry {
60
+ parentId: number;
61
+ index: number;
62
+ }
63
+ /**
64
+ * The items from `k` on whose parent is `parentId`, in order.
65
+ *
66
+ * @ensures each kept item's parent is parentId — exactly the model's DirectChildren in the link
67
+ */
68
+ export declare function directChildrenFrom(items: ParentEntry[], parentId: number, k: number): ParentEntry[];
69
+ /**
70
+ * The group titles from `k` on that are not empty, in order (the profile's permissions).
71
+ *
72
+ * @ensures every title kept is non-empty — exactly the model's NonEmptyTitles in the link
73
+ */
74
+ export declare function nonEmptyTitlesFrom(titles: string[], k: number): string[];
75
+ /** The profile's id: the user id as decimal text. */
76
+ export declare function profileId(id: number): string;
77
+ /** addFavorite sends the one item as a list. */
78
+ export declare function oneUid(uid: number): number[];
79
+ /** The site's cache prefix: its siteId scoped, or none without one. */
80
+ export declare function sitePrefix(siteId: string): string;
81
+ /**
82
+ * Which cache values a service's factory gets: none (commerce), the prefix alone, the short
83
+ * bundle, the short and long bundle, or the long values alone (agr-site).
84
+ */
85
+ export type Bundle = "noCacheConfig" | "prefixOnly" | "shortBundle" | "longBundle" | "longOnly";
86
+ /** The bundle for a service, by its name in `site.actions`. */
87
+ export declare function bundleOf(service: string): Bundle;
88
+ /** Where the hybrid proxy sends a property: nothing, the memo, a legacy service, the SDK mirror. */
89
+ export type Route = "noRoute" | "memo" | "legacy" | "fallback";
90
+ /** The service-level route: a symbol is nothing, a memo hit the memo, an own service legacy. */
91
+ export declare function serviceRoute(isSymbol: boolean, memoHit: boolean, hasOwn: boolean): Route;
92
+ /** The method-level route inside a legacy service: its own method first, else the mirror's. */
93
+ export declare function methodRoute(isSymbol: boolean, inService: boolean): Route;
94
+ /**
95
+ * wrapCall caches a read only on a tier with a Redis TTL above 0 (`hasTtl` the tier has one, `ttl`
96
+ * its value or 0: lsc can't narrow an optional inside `&&`, models/LSC-GAPS.md).
97
+ */
98
+ export declare function wrapCaches(isRead: boolean, hasTtl: boolean, ttl: number): boolean;
99
+ //# sourceMappingURL=action-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-rules.d.ts","sourceRoot":"","sources":["../../src/actions/action-rules.ts"],"names":[],"mappings":"AAYA,oFAAoF;AACpF,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAqBD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,QAAQ,EAAE,CAQnE;AAED,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAKlF;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,GAAG,SAAS,CAKpB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,gGAAgG;AAChG,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,GAAG,eAAe,CAOjG;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAA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E,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAUxE;AAED,qDAAqD;AACrD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAM5C;AAID,gDAAgD;AAChD,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAI5C;AAID,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,UAAU,CAAC;AA4BhG,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWhD;AAED,oGAAoG;AACpG,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/D,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,CAUxF;AAED,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,KAAK,CAQxE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAIjF"}
@@ -1,26 +1,18 @@
1
1
  import type { AgrSiteTypes, AugurAPI } from "@simpleapps-com/augur-api";
2
- import type { Seconds } from "../duration";
3
- import type { EdgeCacheValue, ListResult } from "../sdk-call";
2
+ import { type AllRows, type SpecReadConfig } from "../cache/spec-read";
4
3
  /** Derived from augur-api SDK — keeps types in sync automatically. */
5
4
  export type AgrSiteApiClient = Pick<AugurAPI, "agrSite">;
6
- export interface AgrSiteActionsConfig {
7
- /** Cache key prefix (e.g. "example:"). Default: "". */
8
- cachePrefix?: string;
9
- /** CDN edge cache value for rarely-changing data. Default: 8 (hours). */
10
- longEdgeCache?: EdgeCacheValue;
11
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
12
- longRedisTtl?: Seconds;
13
- }
5
+ /** Cache values: both reads use the long pair (`longEdgeCache`, `longRedisTtl`). */
6
+ export type AgrSiteActionsConfig = SpecReadConfig;
14
7
  export interface AgrSiteActions {
15
- getSettings: (serviceName: string) => Promise<ListResult>;
8
+ /** Every setting of the service (paged to the end). */
9
+ getSettings: (serviceName: string) => Promise<AllRows>;
16
10
  /** The site's generated robots.txt (`{ content, contentType }`). Replaces `getMetaFiles`. */
17
11
  getRobots: () => Promise<AgrSiteTypes.MetaFilesRobotsListData>;
18
12
  }
19
13
  /**
20
- * Creates server-side AGR Site actions with Redis caching and edge cache support.
21
- *
22
- * Covers the AGR Site microservice settings and robots.txt endpoints. Uses long
23
- * TTLs since site settings and meta files rarely change.
14
+ * Creates server-side AGR Site actions: settings and robots.txt, on the long tier since they
15
+ * rarely change. Each read is a spec (`read-specs.ts`).
24
16
  *
25
17
  * @example
26
18
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"agr-site.d.ts","sourceRoot":"","sources":["../../src/actions/agr-site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1D,6FAA6F;IAC7F,SAAS,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;CAChE;AAED;;;;;;;;;;;;;;;;;SAiBS;AACT,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EACrB,MAAM,GAAE,oBAAyB,GAChC,cAAc,CA8BhB"}
1
+ {"version":3,"file":"agr-site.d.ts","sourceRoot":"","sources":["../../src/actions/agr-site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAA+B,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpG,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAEzD,oFAAoF;AACpF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,6FAA6F;IAC7F,SAAS,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;CAChE;AAED;;;;;;;;;;;;;;;SAeS;AACT,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EACrB,MAAM,GAAE,oBAAyB,GAChC,cAAc,CAqBhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"commerce.d.ts","sourceRoot":"","sources":["../../src/actions/commerce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,2BAA2B,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
  import type { AugurAPI, CustomersTypes } from "@simpleapps-com/augur-api";
2
- import type { Seconds } from "../duration";
3
2
  import type { CustomerDocument } from "@simpleapps-com/augur-utils";
4
- import type { EdgeCacheValue, ListResult } from "../sdk-call";
3
+ import type { ListResult } from "../sdk-call";
4
+ import { type AllRows, type SpecReadConfig } from "../cache/spec-read";
5
5
  /** Derived from augur-api SDK — keeps types in sync automatically. */
6
6
  export type CustomersApiClient = Pick<AugurAPI, "customers">;
7
- export interface CustomersActionsConfig {
8
- /** Cache key prefix (e.g. "example:"). Default: "". */
9
- cachePrefix?: string;
10
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
11
- edgeCache?: EdgeCacheValue;
12
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
13
- redisTtl?: Seconds;
14
- }
7
+ /**
8
+ * Cache values. A customer's records are a user path (augur-core `USER_PATHS`, atlas#102): they
9
+ * change in P21, so the server never caches them, whatever these say; the browser keeps a short
10
+ * cache.
11
+ */
12
+ export type CustomersActionsConfig = SpecReadConfig;
15
13
  export interface CustomersActions {
16
14
  customerLookup: (params: CustomersTypes.CustomerLookupGetParams) => Promise<ListResult<CustomersTypes.CustomerLookupGetItem>>;
17
15
  getCustomerDoc: (customerId: number) => Promise<CustomerDocument>;
@@ -21,13 +19,12 @@ export interface CustomersActions {
21
19
  getCustomerInvoiceDetail: (customerId: number, invoiceNo: number) => Promise<unknown>;
22
20
  getCustomerQuotes: (customerId: number, params?: Record<string, unknown>) => Promise<ListResult>;
23
21
  getCustomerQuoteDetail: (customerId: number, quoteNo: number) => Promise<unknown>;
24
- getShipToAddresses: (customerId: number) => Promise<ListResult>;
22
+ /** Every ship-to address (paged to the end), and whether the page cap stopped the read. */
23
+ getShipToAddresses: (customerId: number) => Promise<AllRows>;
25
24
  }
26
25
  /**
27
- * Creates server-side customer actions with Redis caching and edge cache support.
28
- *
29
- * Covers the customers microservice endpoints used by ecommerce sites:
30
- * customer lookup, doc, orders, invoices, quotes, and ship-to addresses.
26
+ * Creates server-side customer actions: customer lookup, doc, orders, invoices, quotes and
27
+ * ship-to addresses. Each read is a spec (`read-specs.ts`); none is cached on the server.
31
28
  *
32
29
  * @example
33
30
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/actions/customers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACrC,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,gBAAgB;IAC/B,cAAc,EAAE,CACd,MAAM,EAAE,cAAc,CAAC,uBAAuB,KAC3C,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC/D,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAClE,iBAAiB,EAAE,CACjB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,cAAc,CAAC,wBAAwB,KAC7C,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClF,mBAAmB,EAAE,CACnB,U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B,KAC3C,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC/D,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAClE,iBAAiB,EAAE,CACjB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,cAAc,CAAC,wBAAwB,KAC7C,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClF,mBAAmB,EAAE,CACnB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,cAAc,CAAC,0BAA0B,KAC/C,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,wBAAwB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtF,iBAAiB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACjG,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClF,2FAA2F;IAC3F,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9D;AAED;;;;;;;;;;;;;;;SAeS;AACT,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,kBAAkB,EACvB,MAAM,GAAE,sBAA2B,GAClC,gBAAgB,CA2HlB"}
@@ -1,21 +1,18 @@
1
1
  import type { AugurAPI } from "@simpleapps-com/augur-api";
2
- import type { Seconds } from "../duration";
3
- import type { EdgeCacheValue, ListResult } from "../sdk-call";
2
+ import { type AllRows, type SpecReadConfig } from "../cache/spec-read";
4
3
  /** Derived from augur-api SDK — keeps types in sync automatically. */
5
4
  export type FavoritesApiClient = Pick<AugurAPI, "items">;
6
- export interface FavoritesActionsConfig {
7
- /** Cache key prefix (e.g. "example:"). Default: "". */
8
- cachePrefix?: string;
9
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
10
- edgeCache?: EdgeCacheValue;
11
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
12
- redisTtl?: Seconds;
13
- }
5
+ /**
6
+ * Cache values. Favorites are a user path (augur-core `USER_PATHS`, atlas#102): the server never
7
+ * caches them, whatever these say; the browser keeps a short cache its own writes clear.
8
+ */
9
+ export type FavoritesActionsConfig = SpecReadConfig;
14
10
  export interface FavoritesActions {
15
- getFavorites: (userId: number) => Promise<ListResult>;
11
+ /** Every favorite of the user (paged to the end), and whether the page cap stopped the read. */
12
+ getFavorites: (userId: number) => Promise<AllRows>;
16
13
  addFavorite: (userId: number, invMastUid: number) => Promise<unknown>;
17
14
  removeFavorite: (userId: number, invMastUid: number) => Promise<void>;
18
15
  }
19
- /** Creates server-side favorites actions with Redis caching and edge cache support. */
16
+ /** Creates server-side favorites actions: the read pages to the end and is never cached. */
20
17
  export declare function createFavoritesActions(api: FavoritesApiClient, config?: FavoritesActionsConfig): FavoritesActions;
21
18
  //# sourceMappingURL=favorites.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"favorites.d.ts","sourceRoot":"","sources":["../../src/actions/favorites.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,sBAAsB;IACrC,uD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KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,4FAA4F;AAC5F,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,kBAAkB,EACvB,MAAM,GAAE,sBAA2B,GAClC,gBAAgB,CAelB"}
@@ -1,24 +1,16 @@
1
1
  import type { AugurAPI } from "@simpleapps-com/augur-api";
2
- import type { Seconds } from "../duration";
3
- import type { EdgeCacheValue, ListResult } from "../sdk-call";
2
+ import { type AllRows, type SpecReadConfig } from "../cache/spec-read";
4
3
  /** Derived from augur-api SDK — keeps types in sync automatically. */
5
4
  export type GregorovichApiClient = Pick<AugurAPI, "gregorovich">;
6
- export interface GregorovichActionsConfig {
7
- /** Cache key prefix (e.g. "example:"). Default: "". */
8
- cachePrefix?: string;
9
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
10
- edgeCache?: EdgeCacheValue;
11
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
12
- redisTtl?: Seconds;
13
- }
5
+ /** Cache values: the short Redis TTL; no edge value is sent (today's behaviour). */
6
+ export type GregorovichActionsConfig = SpecReadConfig;
14
7
  export interface GregorovichActions {
15
- getDocuments: (params?: Record<string, unknown>) => Promise<ListResult>;
8
+ /** Every document (paged to the end), and whether the page cap stopped the read. */
9
+ getDocuments: (params?: Record<string, unknown>) => Promise<AllRows>;
16
10
  }
17
11
  /**
18
- * Creates server-side gregorovich actions with Redis caching and edge cache support.
19
- *
20
- * Covers the Gregorovich service's document listing, the only endpoint the SDK
21
- * exposes since augur-api 2026.10.8.
12
+ * Creates server-side gregorovich actions: the Gregorovich service's document listing, the only
13
+ * endpoint the SDK exposes since augur-api 2026.10.8. The read is a spec (`read-specs.ts`).
22
14
  *
23
15
  * @example
24
16
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"gregorovich.d.ts","sourceRoot":"","sources":["../../src/actions/gregorovich.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,O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AAgB,wBAAwB,CACtC,GAAG,EAAE,oBAAoB,EACzB,MAAM,GAAE,wBAA6B,GACpC,kBAAkB,CAcpB"}
@@ -1,22 +1,12 @@
1
1
  import type { AugurAPI } from "@simpleapps-com/augur-api";
2
- import type { Seconds } from "../duration";
3
2
  import type { GetItemCategoryApiOptions } from "@simpleapps-com/augur-hooks";
4
- import type { EdgeCacheValue, ListResult } from "../sdk-call";
3
+ import type { ListResult } from "../sdk-call";
5
4
  import type { TAttribute, TCategory, TCategoryItemsResult, TInvMast, TInvMastDoc, TItemAccessory, TItemsFilters, TProductItem, TStock } from "@simpleapps-com/augur-utils";
5
+ import { type AllRows, type SpecReadConfig } from "../cache/spec-read";
6
6
  import type { PaginatedResult } from "../pagination";
7
7
  /** Derived from augur-api SDK — keeps types in sync automatically. */
8
8
  export type ItemsApiClient = Pick<AugurAPI, "items">;
9
- export interface ItemActionsConfig {
10
- /** Cache key prefix (e.g. "example:"). Default: "". */
11
- cachePrefix?: string;
12
- /** CDN edge cache value for most calls. Default: 1 (hour). */
13
- edgeCache?: EdgeCacheValue;
14
- /** CDN edge cache for rarely-changing data like FAQs. Default: 8 (hours). */
15
- longEdgeCache?: EdgeCacheValue;
16
- /** Redis TTL for most calls in seconds. Default: 3600 (1 hour). */
17
- redisTtl?: Seconds;
18
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
19
- longRedisTtl?: Seconds;
9
+ export interface ItemActionsConfig extends SpecReadConfig {
20
10
  /** Sort category children by sequenceNo. Default: true. */
21
11
  sortChildren?: boolean;
22
12
  /** Prefix prepended to sortBy filter values (e.g. "item_category_sequence_no_min|"). */
@@ -46,9 +36,9 @@ export interface ItemActions {
46
36
  };
47
37
  getStock: (invMastUid: number) => Promise<TStock>;
48
38
  getStockCompanySummary: (invMastUid: number) => Promise<Record<string, number>>;
49
- getItemFaqs: (invMastUid: number) => Promise<ListResult>;
50
- getItemSubstitutes: (invMastUid: number) => Promise<ListResult>;
51
- getItemAccessories: (invMastUid: number) => Promise<ListResult<TItemAccessory>>;
39
+ getItemFaqs: (invMastUid: number) => Promise<AllRows>;
40
+ getItemSubstitutes: (invMastUid: number) => Promise<AllRows>;
41
+ getItemAccessories: (invMastUid: number) => Promise<AllRows<TItemAccessory>>;
52
42
  getSimilarItems: (invMastUid: number) => Promise<ListResult>;
53
43
  batchGetInvMastDocs: (params: {
54
44
  invMastUid?: number;
@@ -57,10 +47,8 @@ export interface ItemActions {
57
47
  batchGetStockData: (invMastUids: number[]) => Promise<Record<number, TStock>>;
58
48
  }
59
49
  /**
60
- * Creates server-side item actions with Redis caching and edge cache support.
61
- *
62
- * Uses `withServerCache` which produces cache keys compatible with augur-hooks'
63
- * `withCache`, so server-prefetched data is shared with client-side hooks.
50
+ * Creates server-side item actions. Each read is a spec (`read-specs.ts`); the decisions are the
51
+ * proved `action-rules.ts`.
64
52
  *
65
53
  * @example
66
54
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../src/actions/items.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,2BAA2B,CAAC;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,MAAM,EACP,MAAM,6BAA6B,CAAC;AAMrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,WAAW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AAM,KAAK,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;IAC7E,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAG7D,mBAAmB,EAAE,CACnB,MAAM,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,KAC/C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAC1C,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/E;AAkBD;;;;;;;;;;;;;;;;;SAiBS;AACT,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,cAAc,EACnB,MAAM,GAAE,iBAAsB,GAC7B,WAAW,CAiQb"}
@@ -1,17 +1,14 @@
1
1
  import type { AugurAPI } from "@simpleapps-com/augur-api";
2
- import type { Seconds } from "../duration";
3
2
  import type { MenuItem, TJoomlaContent, TMenu, TPasswordVerification } from "@simpleapps-com/augur-utils";
4
- import type { EdgeCacheValue, ListResult } from "../sdk-call";
3
+ import type { ListResult } from "../sdk-call";
4
+ import { type SpecReadConfig } from "../cache/spec-read";
5
5
  /** Derived from augur-api SDK — keeps types in sync automatically. */
6
6
  export type JoomlaApiClient = Pick<AugurAPI, "joomla">;
7
- export interface JoomlaActionsConfig {
8
- /** Cache key prefix (e.g. "example:"). Default: "". */
9
- cachePrefix?: string;
10
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
11
- edgeCache?: EdgeCacheValue;
12
- /** Redis TTL for Joomla lookups in seconds. Default: 3600 (1 hour). */
13
- redisTtl?: Seconds;
14
- }
7
+ /**
8
+ * Cache values. A user's profile is a user path (augur-core `USER_PATHS`, atlas#102): the server
9
+ * never caches it, whatever these say.
10
+ */
11
+ export type JoomlaActionsConfig = SpecReadConfig;
15
12
  export interface NormalizedUserProfile {
16
13
  id: string;
17
14
  name: string;
@@ -37,10 +34,7 @@ export interface JoomlaActions {
37
34
  verifyPassword: (username: string, password: string) => Promise<TPasswordVerification>;
38
35
  }
39
36
  /**
40
- * Creates server-side Joomla content actions with Redis caching and edge cache support.
41
- *
42
- * Uses `withServerCache` which produces cache keys compatible with augur-hooks'
43
- * `withCache`, so server-prefetched data is shared with client-side hooks.
37
+ * Creates server-side Joomla content actions. Each read is a spec (`read-specs.ts`).
44
38
  *
45
39
  * @example
46
40
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"joomla.d.ts","sourceRoot":"","sources":["../../src/actions/joomla.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,KAAK,EACL,qBAAqB,EAEtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,gBAAgB,EAAE;QAChB,CAAC,S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GAAG,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC5E,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACxF;AAyBD;;;;;;;;;;;;;;;;SAgBS;AACT,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,eAAe,EACpB,MAAM,GAAE,mBAAwB,GAC/B,aAAa,CAyHf"}
@@ -1,34 +1,24 @@
1
1
  import type { AugurAPI, LegacyTypes } from "@simpleapps-com/augur-api";
2
- import type { Seconds } from "../duration";
3
2
  import type { TWebDesc } from "@simpleapps-com/augur-utils";
4
- import type { EdgeCacheValue, ListResult } from "../sdk-call";
3
+ import type { ListResult } from "../sdk-call";
4
+ import { type AllRows, type SpecReadConfig } from "../cache/spec-read";
5
5
  /** Derived from augur-api SDK — keeps types in sync automatically. */
6
6
  export type LegacyApiClient = Pick<AugurAPI, "legacy">;
7
- export interface LegacyActionsConfig {
8
- /** Cache key prefix (e.g. "example:"). Default: "". */
9
- cachePrefix?: string;
10
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
11
- edgeCache?: EdgeCacheValue;
12
- /** CDN edge cache for rarely-changing data like states. Default: 8 (hours). */
13
- longEdgeCache?: EdgeCacheValue;
14
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
15
- redisTtl?: Seconds;
16
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
17
- longRedisTtl?: Seconds;
18
- }
7
+ /** Cache values: the short pair for item data, the long pair for states. */
8
+ export type LegacyActionsConfig = SpecReadConfig;
19
9
  export interface LegacyActions {
20
10
  getItemWebDesc: (invMastUid: number) => Promise<TWebDesc | undefined>;
21
11
  getAlsoBoughtItems: (invMastUid: number) => Promise<ListResult<LegacyTypes.InvMastAlsoBoughtListItem>>;
22
- getItemTags: (invMastUid: number) => Promise<ListResult>;
12
+ /** Every tag of the item (paged to the end). */
13
+ getItemTags: (invMastUid: number) => Promise<AllRows>;
14
+ /** Every state (paged to the end), or the one with `twoLetterCode`. */
23
15
  getStates: (params?: {
24
16
  twoLetterCode?: string;
25
- }) => Promise<ListResult>;
17
+ }) => Promise<AllRows>;
26
18
  }
27
19
  /**
28
- * Creates server-side legacy actions with Redis caching and edge cache support.
29
- *
30
- * Covers the legacy microservice endpoints used by ecommerce sites:
31
- * webDesc, alsoBought, tags, and states.
20
+ * Creates server-side legacy actions: webDesc, alsoBought, tags and states. Each read is a spec
21
+ * (`read-specs.ts`); tags and states page to the end.
32
22
  *
33
23
  * @example
34
24
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../../src/actions/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,C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IAChE,gDAAgD;IAChD,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,uEAAuE;IACvE,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACtE;AAOD;;;;;;;;;;;;;;;SAeS;AACT,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,eAAe,EACpB,MAAM,GAAE,mBAAwB,GAC/B,aAAa,CAiCf"}
@@ -1,24 +1,17 @@
1
1
  import type { AugurAPI } from "@simpleapps-com/augur-api";
2
- import type { Seconds } from "../duration";
3
- import type { EdgeCacheValue } from "../sdk-call";
2
+ import { type SpecReadConfig } from "../cache/spec-read";
4
3
  /** Derived from augur-api SDK — keeps types in sync automatically. */
5
4
  export type OrderApiClient = Pick<AugurAPI, "orders">;
6
- export interface OrderActionsConfig {
7
- /** Cache key prefix (e.g. "example:"). Default: "". */
8
- cachePrefix?: string;
9
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
10
- edgeCache?: EdgeCacheValue;
11
- /** Redis TTL for order doc lookups in seconds. Default: 3600 (1 hour). */
12
- redisTtl?: Seconds;
13
- }
5
+ /**
6
+ * Cache values. An order is a user path (augur-core `USER_PATHS`, atlas#102): its status changes
7
+ * in P21, so the server never caches it, whatever these say; the browser keeps a short cache.
8
+ */
9
+ export type OrderActionsConfig = SpecReadConfig;
14
10
  export interface OrderActions {
15
11
  getOrderDoc: (orderNo: string, postalCode: string) => Promise<unknown>;
16
12
  }
17
13
  /**
18
- * Creates server-side order actions with Redis caching and edge cache support.
19
- *
20
- * Uses `withServerCache` which produces cache keys compatible with augur-hooks'
21
- * `withCache`, so server-prefetched data is shared with client-side hooks.
14
+ * Creates server-side order actions. The read is a spec (`read-specs.ts`).
22
15
  *
23
16
  * @example
24
17
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/actions/orders.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,MAAM,aAAa,CAAC;AAGlD,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE;AAED;;;;;;;;;;;;;;;;;;SAkBS;AACT,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EACnB,MAAM,GAAE,kBAAuB,GAC9B,YAAY,CAqBd"}
1
+ {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/actions/orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAG3E,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE;AA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