@simpleapps-com/augur-server 2.4.0 → 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.
Files changed (141) hide show
  1. package/EXPORTS.md +30 -73
  2. package/README.md +29 -198
  3. package/dist/actions/agr-info.d.ts +44 -0
  4. package/dist/actions/agr-info.d.ts.map +1 -0
  5. package/dist/actions/agr-site.d.ts +38 -0
  6. package/dist/actions/agr-site.d.ts.map +1 -0
  7. package/dist/actions/agr-work.d.ts +29 -0
  8. package/dist/actions/agr-work.d.ts.map +1 -0
  9. package/dist/actions/avalara.d.ts +38 -0
  10. package/dist/actions/avalara.d.ts.map +1 -0
  11. package/dist/actions/basecamp2.d.ts +48 -0
  12. package/dist/actions/basecamp2.d.ts.map +1 -0
  13. package/dist/actions/brand-folder.d.ts +39 -0
  14. package/dist/actions/brand-folder.d.ts.map +1 -0
  15. package/dist/actions/commerce.d.ts +58 -0
  16. package/dist/actions/commerce.d.ts.map +1 -0
  17. package/dist/actions/customers.d.ts +45 -0
  18. package/dist/actions/customers.d.ts.map +1 -0
  19. package/dist/actions/favorites.d.ts +21 -0
  20. package/dist/actions/favorites.d.ts.map +1 -0
  21. package/dist/actions/gregorovich.d.ts +35 -0
  22. package/dist/actions/gregorovich.d.ts.map +1 -0
  23. package/dist/actions/items.d.ts +81 -0
  24. package/dist/actions/items.d.ts.map +1 -0
  25. package/dist/actions/joomla.d.ts +60 -0
  26. package/dist/actions/joomla.d.ts.map +1 -0
  27. package/dist/actions/legacy.d.ts +46 -0
  28. package/dist/actions/legacy.d.ts.map +1 -0
  29. package/dist/actions/logistics.d.ts +41 -0
  30. package/dist/actions/logistics.d.ts.map +1 -0
  31. package/dist/actions/orders.d.ts +37 -0
  32. package/dist/actions/orders.d.ts.map +1 -0
  33. package/dist/actions/p21-apis.d.ts +34 -0
  34. package/dist/actions/p21-apis.d.ts.map +1 -0
  35. package/dist/actions/p21-core.d.ts +47 -0
  36. package/dist/actions/p21-core.d.ts.map +1 -0
  37. package/dist/actions/p21-pim.d.ts +37 -0
  38. package/dist/actions/p21-pim.d.ts.map +1 -0
  39. package/dist/actions/p21-sism.d.ts +38 -0
  40. package/dist/actions/p21-sism.d.ts.map +1 -0
  41. package/dist/actions/payments.d.ts +39 -0
  42. package/dist/actions/payments.d.ts.map +1 -0
  43. package/dist/actions/pricing.d.ts +46 -0
  44. package/dist/actions/pricing.d.ts.map +1 -0
  45. package/dist/actions/search.d.ts +62 -0
  46. package/dist/actions/search.d.ts.map +1 -0
  47. package/dist/actions/shipping.d.ts +57 -0
  48. package/dist/actions/shipping.d.ts.map +1 -0
  49. package/dist/actions/site.d.ts +142 -0
  50. package/dist/actions/site.d.ts.map +1 -0
  51. package/dist/actions/smarty-streets.d.ts +45 -0
  52. package/dist/actions/smarty-streets.d.ts.map +1 -0
  53. package/dist/actions/vmi.d.ts +45 -0
  54. package/dist/actions/vmi.d.ts.map +1 -0
  55. package/dist/actions/wishlists.d.ts +29 -0
  56. package/dist/actions/wishlists.d.ts.map +1 -0
  57. package/dist/api-handler.d.ts +25 -0
  58. package/dist/api-handler.d.ts.map +1 -0
  59. package/dist/api.d.ts +2 -26
  60. package/dist/api.d.ts.map +1 -0
  61. package/dist/api.js +19 -14
  62. package/dist/api.js.map +1 -1
  63. package/dist/auth.d.ts +10 -12
  64. package/dist/auth.d.ts.map +1 -0
  65. package/dist/auth.js +2 -2
  66. package/dist/cache/redis-client.d.ts +18 -0
  67. package/dist/cache/redis-client.d.ts.map +1 -0
  68. package/dist/cache/with-cache.d.ts +17 -0
  69. package/dist/cache/with-cache.d.ts.map +1 -0
  70. package/dist/{chunk-PIYHMA6F.js → chunk-6CSVIBHQ.js} +15 -18
  71. package/dist/chunk-6CSVIBHQ.js.map +1 -0
  72. package/dist/{chunk-ALTIINP6.js → chunk-A4IVBK6P.js} +30 -6
  73. package/dist/chunk-A4IVBK6P.js.map +1 -0
  74. package/dist/{chunk-KHFEDL47.js → chunk-INVDQQ7T.js} +18 -12
  75. package/dist/chunk-INVDQQ7T.js.map +1 -0
  76. package/dist/{chunk-26WZBC4F.js → chunk-LX7SJJOU.js} +275 -667
  77. package/dist/chunk-LX7SJJOU.js.map +1 -0
  78. package/dist/chunk-OBWQSGB6.js +205 -0
  79. package/dist/chunk-OBWQSGB6.js.map +1 -0
  80. package/dist/{chunk-2NL4QKJN.js → chunk-UVGG74FO.js} +31 -30
  81. package/dist/chunk-UVGG74FO.js.map +1 -0
  82. package/dist/duration.d.ts +16 -0
  83. package/dist/duration.d.ts.map +1 -0
  84. package/dist/environment.d.ts +10 -0
  85. package/dist/environment.d.ts.map +1 -0
  86. package/dist/hooks.d.ts +8 -10
  87. package/dist/hooks.d.ts.map +1 -0
  88. package/dist/hooks.js +3 -3
  89. package/dist/hooks.js.map +1 -1
  90. package/dist/index.d.ts +16 -125
  91. package/dist/index.d.ts.map +1 -0
  92. package/dist/index.js +9 -7
  93. package/dist/index.js.map +1 -1
  94. package/dist/pagination.d.ts +32 -0
  95. package/dist/pagination.d.ts.map +1 -0
  96. package/dist/query-action.d.ts +15 -117
  97. package/dist/query-action.d.ts.map +1 -0
  98. package/dist/query-action.js +3 -3
  99. package/dist/query-options-helper.d.ts +34 -0
  100. package/dist/query-options-helper.d.ts.map +1 -0
  101. package/dist/query.js +1 -2
  102. package/dist/recaptcha.d.ts +6 -0
  103. package/dist/recaptcha.d.ts.map +1 -0
  104. package/dist/rules.d.ts +230 -0
  105. package/dist/rules.d.ts.map +1 -0
  106. package/dist/scoped-client-key.d.ts +9 -0
  107. package/dist/scoped-client-key.d.ts.map +1 -0
  108. package/dist/sdk-call.d.ts +66 -0
  109. package/dist/sdk-call.d.ts.map +1 -0
  110. package/dist/sdk-client-store.d.ts +250 -0
  111. package/dist/sdk-client-store.d.ts.map +1 -0
  112. package/dist/server-actions.d.ts +2 -0
  113. package/dist/server-actions.d.ts.map +1 -0
  114. package/dist/server-query-client.d.ts +19 -0
  115. package/dist/server-query-client.d.ts.map +1 -0
  116. package/dist/{server-site-registry-CdBfczOj.d.ts → server-site-registry.d.ts} +7 -9
  117. package/dist/server-site-registry.d.ts.map +1 -0
  118. package/dist/{site.d.ts → server-site.d.ts} +11 -16
  119. package/dist/server-site.d.ts.map +1 -0
  120. package/dist/site-actions-store.d.ts +27 -0
  121. package/dist/site-actions-store.d.ts.map +1 -0
  122. package/dist/site.js +15 -14
  123. package/dist/site.js.map +1 -1
  124. package/dist/testing.d.ts +9 -12
  125. package/dist/testing.d.ts.map +1 -0
  126. package/dist/testing.js +7 -27
  127. package/dist/testing.js.map +1 -1
  128. package/dist/utils/batch-fetch.d.ts +7 -0
  129. package/dist/utils/batch-fetch.d.ts.map +1 -0
  130. package/llms.txt +72 -51
  131. package/package.json +30 -20
  132. package/dist/actions.d.ts +0 -2
  133. package/dist/chunk-26WZBC4F.js.map +0 -1
  134. package/dist/chunk-2NL4QKJN.js.map +0 -1
  135. package/dist/chunk-ALTIINP6.js.map +0 -1
  136. package/dist/chunk-DGUM43GV.js +0 -11
  137. package/dist/chunk-DGUM43GV.js.map +0 -1
  138. package/dist/chunk-KHFEDL47.js.map +0 -1
  139. package/dist/chunk-PIYHMA6F.js.map +0 -1
  140. package/dist/query.d.ts +0 -35
  141. package/dist/site-BjSFqufX.d.ts +0 -469
package/EXPORTS.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # @simpleapps-com/augur-server exports
2
2
 
3
- Version: 2.2.29
4
-
5
- > Auto-generated from built type declarations. Do not edit manually.
6
- > Regenerate with: `pnpm run generate-exports`
3
+ > Generated from the package's build by `pnpm -C repo/sites/augur-build generate`. Do not edit by hand.
4
+ > Guide: https://augur.build/docs/packages/augur-server
7
5
 
8
6
  ## `@simpleapps-com/augur-server`
9
7
 
@@ -11,41 +9,33 @@ Version: 2.2.29
11
9
 
12
10
  | Export | Kind | Description |
13
11
  |--------|------|-------------|
14
- | `ActionResult` | value | |
15
- | `EdgeCacheValue` | value | |
16
- | `QueryOptionsConfig` | value | |
17
- | `SafeActionResult` | value | |
18
- | `batchFetch` | function | Fetches data for multiple params in parallel, returning a Record keyed by |
19
- | `cacheGet` | function | Read a cached value by key. |
20
- | `cacheSet` | function | Write a value to cache with a TTL. Fire-and-forget semantics: no-ops |
21
- | `createQueryOptions` | value | |
12
+ | `batchFetch` | function | Fetches data for multiple params in parallel, returning a Record keyed by `getKey(param)`. Individual failures are silently excluded from the result so one bad item never takes down the entire batch. |
13
+ | `cacheGet` | function | Read a cached value by key. Returns `null` on cache miss, circuit-open, connection failure, or if Redis is unavailable. Never throws. |
14
+ | `cacheSet` | function | Write a value to cache with a TTL. Fire-and-forget semantics: no-ops silently when the circuit is open or Redis is unavailable. Never throws. |
15
+ | `createQueryOptions` | const | Creates useQuery options with consistent key generation. Filters out undefined/null/empty params from the query key. |
22
16
  | `createServerQueryClient` | function | Creates a server-side query client optimised for prefetching. |
23
- | `createSiteActions` | function | |
24
- | `createSuspenseQueryOptions` | value | |
17
+ | `createSiteActions` | function | Creates a unified site actions object with all service factories. |
18
+ | `createSuspenseQueryOptions` | const | Creates useSuspenseQuery options with consistent key generation. Same as createQueryOptions but without enabledFn (suspense queries cannot be disabled). |
25
19
  | `env` | const | Resolved environment: `"development"`, `"staging"`, or `"production"`. |
26
20
  | `getCircuitState` | function | Returns the current circuit breaker state. |
27
21
  | `getServerQueryClient` | const | Returns a per-request singleton QueryClient for React Server Components. |
28
- | `getSiteActions` | function | |
22
+ | `getSiteActions` | function | Returns the registered site actions instance. |
29
23
  | `isDev` | const | `true` when running locally (localhost / NODE_ENV=development). |
30
24
  | `isProduction` | const | `true` when running on the production deployment. |
31
25
  | `isRedisConnected` | function | Whether the Redis client is connected and ready to accept commands. |
32
26
  | `isStaging` | const | `true` when running on the staging/dev deployment. |
33
- | `paginateOffset` | function | |
34
- | `registerSiteActions` | function | |
35
- | `safeAction` | function | Wraps an async function call with error handling, returning a |
27
+ | `paginateOffset` | function | Wraps a list of items with offset-based pagination metadata. |
28
+ | `registerSiteActions` | function | Stores the site actions instance for use by server action exports. Called automatically by {@link createServerSite}. |
29
+ | `safeAction` | function | Wraps an async function call with error handling, returning a `SafeActionResult<T>` instead of throwing. |
36
30
  | `sdkCall` | function | Calls an Augur SDK method, forwarding all arguments with full type safety. |
37
31
  | `unwrap` | value | |
38
32
  | `unwrapOr` | value | |
39
- | `verifyRecaptcha` | function | Server-side Google reCAPTCHA v3 verification. |
40
- | `withServerCache` | function | Server-side cache wrapper using augur-server's Redis client. |
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. |
41
35
 
42
36
  ### Types
43
37
 
44
- `PaginatedResult`, `SiteActions`, `SiteActionsConfig`
45
-
46
- ```ts
47
- import { ActionResult, EdgeCacheValue, QueryOptionsConfig } from "@simpleapps-com/augur-server";
48
- ```
38
+ `ActionResult`, `EdgeCacheValue`, `PaginatedResult`, `QueryOptionsConfig`, `SafeActionResult`, `SiteActions`, `SiteActionsConfig`
49
39
 
50
40
  ## `@simpleapps-com/augur-server/auth`
51
41
 
@@ -59,46 +49,32 @@ import { ActionResult, EdgeCacheValue, QueryOptionsConfig } from "@simpleapps-co
59
49
 
60
50
  `AugurAuthCallbacks`, `AugurAuthClient`, `AugurJWT`, `AugurSession`, `AugurUser`, `CreateAuthConfigOptions`
61
51
 
62
- ```ts
63
- import { createAuthConfig } from "@simpleapps-com/augur-server/auth";
64
- ```
65
-
66
52
  ## `@simpleapps-com/augur-server/query`
67
53
 
68
54
  ### Values
69
55
 
70
56
  | Export | Kind | Description |
71
57
  |--------|------|-------------|
72
- | `createQueryOptions` | const | Creates useQuery options with consistent key generation. |
73
- | `createSuspenseQueryOptions` | const | Creates useSuspenseQuery options with consistent key generation. |
58
+ | `createQueryOptions` | const | Creates useQuery options with consistent key generation. Filters out undefined/null/empty params from the query key. |
59
+ | `createSuspenseQueryOptions` | const | Creates useSuspenseQuery options with consistent key generation. Same as createQueryOptions but without enabledFn (suspense queries cannot be disabled). |
74
60
 
75
61
  ### Types
76
62
 
77
63
  `QueryOptionsConfig`
78
64
 
79
- ```ts
80
- import { createQueryOptions, createSuspenseQueryOptions } from "@simpleapps-com/augur-server/query";
81
- ```
82
-
83
65
  ## `@simpleapps-com/augur-server/testing`
84
66
 
85
67
  ### Values
86
68
 
87
69
  | Export | Kind | Description |
88
70
  |--------|------|-------------|
89
- | `DeepMockClient` | value | |
90
- | `MockClientResult` | value | |
91
- | `clearSiteActions` | function | |
71
+ | `clearSiteActions` | function | Clears the registered site actions. Used in tests only. |
92
72
  | `createMockClient` | value | |
93
73
  | `createMockSiteActions` | function | Creates a fully-mocked SiteActions object for testing. |
94
74
 
95
75
  ### Types
96
76
 
97
- `MockFn`, `MockSiteActions`, `MockSiteActionsResult`
98
-
99
- ```ts
100
- import { DeepMockClient, MockClientResult, clearSiteActions } from "@simpleapps-com/augur-server/testing";
101
- ```
77
+ `DeepMockClient`, `MockClientResult`, `MockFn`, `MockSiteActions`, `MockSiteActionsResult`
102
78
 
103
79
  ## `@simpleapps-com/augur-server/site`
104
80
 
@@ -106,29 +82,17 @@ import { DeepMockClient, MockClientResult, clearSiteActions } from "@simpleapps-
106
82
 
107
83
  | Export | Kind | Description |
108
84
  |--------|------|-------------|
109
- | `createServerSite` | function | Create a server-side site instance that bundles the SDK client, server |
85
+ | `createServerSite` | function | Create a server-side site instance that bundles the SDK client, server actions, and (optional) NextAuth configuration. |
110
86
 
111
87
  ### Types
112
88
 
113
89
  `ServerSite`, `ServerSiteAuthConfig`, `ServerSiteConfig`
114
90
 
115
- ```ts
116
- import { createServerSite } from "@simpleapps-com/augur-server/site";
117
- ```
118
-
119
91
  ## `@simpleapps-com/augur-server/actions`
120
92
 
121
- ### Values
122
-
123
- | Export | Kind | Description |
124
- |--------|------|-------------|
125
- | `ApiResult` | value | |
126
- | `ListResult` | value | |
127
- | `SafeActionResult` | value | |
93
+ ### Types
128
94
 
129
- ```ts
130
- import { ApiResult, ListResult, SafeActionResult } from "@simpleapps-com/augur-server/actions";
131
- ```
95
+ `ApiResult`, `ListResult`, `SafeActionResult`
132
96
 
133
97
  ## `@simpleapps-com/augur-server/hooks`
134
98
 
@@ -136,12 +100,11 @@ import { ApiResult, ListResult, SafeActionResult } from "@simpleapps-com/augur-s
136
100
 
137
101
  | Export | Kind | Description |
138
102
  |--------|------|-------------|
139
- | `QueryActionFn` | value | |
140
- | `createServerQueryProxy` | function | Creates a client-side proxy that mirrors the SDK namespace and routes |
103
+ | `createServerQueryProxy` | function | Creates a client-side proxy that mirrors the SDK namespace and routes every method call through a server action function. |
104
+
105
+ ### Types
141
106
 
142
- ```ts
143
- import { QueryActionFn, createServerQueryProxy } from "@simpleapps-com/augur-server/hooks";
144
- ```
107
+ `QueryActionFn`
145
108
 
146
109
  ## `@simpleapps-com/augur-server/query-action`
147
110
 
@@ -150,14 +113,10 @@ import { QueryActionFn, createServerQueryProxy } from "@simpleapps-com/augur-ser
150
113
  | Export | Kind | Description |
151
114
  |--------|------|-------------|
152
115
  | `getSessionCredentials` | function | Resolve session credentials from the Auth.js JWT cookie. |
153
- | `queryAction` | function | Generic server action that routes any SDK method call through the raw |
116
+ | `queryAction` | function | Generic server action that routes any SDK method call through the raw SDK client with optional Redis caching. Used internally by `createServerQueryProxy()` to bridge client-side React Query hooks to server-side API calls. |
154
117
  | `resetSessionImports` | function | Reset lazy-loaded imports. Used in tests only. @internal |
155
118
  | `resolveMethod` | function | Resolve a dot-separated method path on an object, returning the leaf function. |
156
- | `unwrapBaseResponse` | function | Unwrap SDK BaseResponse if the result matches the standard shape. |
157
-
158
- ```ts
159
- import { getSessionCredentials, queryAction, resetSessionImports } from "@simpleapps-com/augur-server/query-action";
160
- ```
119
+ | `unwrapBaseResponse` | value | |
161
120
 
162
121
  ## `@simpleapps-com/augur-server/api`
163
122
 
@@ -167,8 +126,6 @@ import { getSessionCredentials, queryAction, resetSessionImports } from "@simple
167
126
  |--------|------|-------------|
168
127
  | `createAugurApiHandler` | function | Creates a Next.js Route Handler that routes method calls through queryAction. |
169
128
 
170
- ```ts
171
- import { createAugurApiHandler } from "@simpleapps-com/augur-server/api";
172
- ```
173
-
174
129
  ## `@simpleapps-com/augur-server/next-auth`
130
+
131
+ No exports.
package/README.md CHANGED
@@ -1,10 +1,13 @@
1
1
  # @simpleapps-com/augur-server
2
2
 
3
- > Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)
3
+ > The server side of an Augur Next.js site: createServerSite, the server query proxy, queryAction, Redis caching, NextAuth and environment detection
4
4
 
5
- > Auto-generated. Do not edit manually. Regenerate with: `pnpm run generate-exports`
5
+ Part of the **@simpleapps-com/augur-\*** platform. Each package releases on its own CalVer
6
+ version; nothing requires them to share one.
6
7
 
7
- Part of the **@simpleapps-com/augur-\*** platform. All packages use fixed versioning (same version number).
8
+ - Guide: https://augur.build/docs/packages/augur-server
9
+ - Every export: [`EXPORTS.md`](EXPORTS.md) (generated from the build)
10
+ - Releases: https://augur.build/docs/packages/changelog
8
11
 
9
12
  ## Install
10
13
 
@@ -12,201 +15,29 @@ Part of the **@simpleapps-com/augur-\*** platform. All packages use fixed versio
12
15
  pnpm add @simpleapps-com/augur-server
13
16
  ```
14
17
 
15
- ### Peer Dependencies
18
+ | Import | Purpose |
19
+ | ------------------------------------------- | ------------------------------------------------------- |
20
+ | `@simpleapps-com/augur-server` | Site actions, caching, `safeAction`, environment, Redis |
21
+ | `@simpleapps-com/augur-server/site` | `createServerSite` |
22
+ | `@simpleapps-com/augur-server/hooks` | `createServerQueryProxy` (registers `queryAction`) |
23
+ | `@simpleapps-com/augur-server/query-action` | `queryAction`, `getSessionCredentials` |
24
+ | `@simpleapps-com/augur-server/api` | `createAugurApiHandler` (fetch mode) |
25
+ | `@simpleapps-com/augur-server/auth` | `createAuthConfig` |
26
+ | `@simpleapps-com/augur-server/query` | `createQueryOptions`, `createSuspenseQueryOptions` |
27
+ | `@simpleapps-com/augur-server/actions` | Types only |
28
+ | `@simpleapps-com/augur-server/testing` | `createMockSiteActions`, `createMockClient` |
29
+ | `@simpleapps-com/augur-server/next-auth` | NextAuth type augmentations |
30
+
31
+ ## Development
32
+
33
+ TypeScript in `src/`, built to `dist/` (ESM) by tsup with `"use server"` and `"use client"`
34
+ banners per entry. The decisions are proved (`src/rules.ts`, `src/scoped-client-key.ts`; model
35
+ `models/AugurServer.dfy`, links `models/links/augur-server-*.dfy`); the rest is tested at 100%.
16
36
 
17
- `@simpleapps-com/augur-api`, `@tanstack/react-query`, `ioredis`, `next`, `next-auth`, `react`
18
-
19
- ## Entry Points
20
-
21
- | Import | Description |
22
- |--------|-------------|
23
- | `@simpleapps-com/augur-server` | 27 exports, 3 types |
24
- | `@simpleapps-com/augur-server/auth` | 1 exports, 6 types |
25
- | `@simpleapps-com/augur-server/query` | 2 exports, 1 types |
26
- | `@simpleapps-com/augur-server/testing` | 5 exports, 3 types |
27
- | `@simpleapps-com/augur-server/site` | 1 exports, 3 types |
28
- | `@simpleapps-com/augur-server/actions` | 3 exports, 0 types |
29
- | `@simpleapps-com/augur-server/hooks` | 2 exports, 0 types |
30
- | `@simpleapps-com/augur-server/query-action` | 5 exports, 0 types |
31
- | `@simpleapps-com/augur-server/api` | 1 exports, 0 types |
32
- | `@simpleapps-com/augur-server/next-auth` | 0 exports, 0 types |
33
-
34
- ## Exports
35
-
36
- ### Auth & Context
37
-
38
- | Export | Kind | Description |
39
- |--------|------|-------------|
40
- | `QueryOptionsConfig` | value | |
41
- | `createQueryOptions` | value | |
42
- | `createSiteActions` | function | |
43
- | `createSuspenseQueryOptions` | value | |
44
- | `getSiteActions` | function | |
45
- | `registerSiteActions` | function | |
46
- | `createAuthConfig` | function | Creates a NextAuth configuration with Joomla credential provider, session callbacks, and automatic cart initialization. |
47
- | `createQueryOptions` | const | Creates useQuery options with consistent key generation. |
48
- | `createSuspenseQueryOptions` | const | Creates useSuspenseQuery options with consistent key generation. |
49
- | `clearSiteActions` | function | |
50
- | `createMockSiteActions` | function | Creates a fully-mocked SiteActions object for testing. |
51
- | `createServerSite` | function | Create a server-side site instance that bundles the SDK client, server |
52
- | `getSessionCredentials` | function | Resolve session credentials from the Auth.js JWT cookie. |
53
- | `resetSessionImports` | function | Reset lazy-loaded imports. Used in tests only. @internal |
54
-
55
- ### Items & Categories
56
-
57
- | Export | Kind | Description |
58
- |--------|------|-------------|
59
- | `isProduction` | const | `true` when running on the production deployment. |
60
-
61
- ### Transforms
62
-
63
- | Export | Kind | Description |
64
- |--------|------|-------------|
65
- | `paginateOffset` | function | |
66
-
67
- ### Utilities
68
-
69
- | Export | Kind | Description |
70
- |--------|------|-------------|
71
- | `unwrap` | value | |
72
- | `unwrapOr` | value | |
73
- | `unwrapBaseResponse` | function | Unwrap SDK BaseResponse if the result matches the standard shape. |
74
-
75
- ### Other
76
-
77
- | Export | Kind | Description |
78
- |--------|------|-------------|
79
- | `ActionResult` | value | |
80
- | `EdgeCacheValue` | value | |
81
- | `SafeActionResult` | value | |
82
- | `batchFetch` | function | Fetches data for multiple params in parallel, returning a Record keyed by |
83
- | `cacheGet` | function | Read a cached value by key. |
84
- | `cacheSet` | function | Write a value to cache with a TTL. Fire-and-forget semantics: no-ops |
85
- | `createServerQueryClient` | function | Creates a server-side query client optimised for prefetching. |
86
- | `env` | const | Resolved environment: `"development"`, `"staging"`, or `"production"`. |
87
- | `getCircuitState` | function | Returns the current circuit breaker state. |
88
- | `getServerQueryClient` | const | Returns a per-request singleton QueryClient for React Server Components. |
89
- | `isDev` | const | `true` when running locally (localhost / NODE_ENV=development). |
90
- | `isRedisConnected` | function | Whether the Redis client is connected and ready to accept commands. |
91
- | `isStaging` | const | `true` when running on the staging/dev deployment. |
92
- | `safeAction` | function | Wraps an async function call with error handling, returning a |
93
- | `sdkCall` | function | Calls an Augur SDK method, forwarding all arguments with full type safety. |
94
- | `verifyRecaptcha` | function | Server-side Google reCAPTCHA v3 verification. |
95
- | `withServerCache` | function | Server-side cache wrapper using augur-server's Redis client. |
96
- | `DeepMockClient` | value | |
97
- | `MockClientResult` | value | |
98
- | `createMockClient` | value | |
99
- | `ApiResult` | value | |
100
- | `ListResult` | value | |
101
- | `SafeActionResult` | value | |
102
- | `QueryActionFn` | value | |
103
- | `createServerQueryProxy` | function | Creates a client-side proxy that mirrors the SDK namespace and routes |
104
- | `queryAction` | function | Generic server action that routes any SDK method call through the raw |
105
- | `resolveMethod` | function | Resolve a dot-separated method path on an object, returning the leaf function. |
106
- | `createAugurApiHandler` | function | Creates a Next.js Route Handler that routes method calls through queryAction. |
107
-
108
- ## Examples
109
-
110
- ### safeAction
111
-
112
- ```ts
113
- const result = await safeAction(
114
- () => actions.commerce.addToCart(cartId, items),
115
- );
116
- if (result.ok) {
117
- // result.data is the response data (undefined for void actions)
118
- } else {
119
- // result.error is the error message
120
- }
121
- ```
122
-
123
- ### sdkCall
124
-
125
- ```ts
126
- const result = await sdkCall(
127
- augurServices.items.invMast.get,
128
- invMastUid,
129
- { edgeCache: 4 },
130
- );
131
- ```
132
-
133
- ### createMockSiteActions
134
-
135
- ```ts
136
- import { createMockSiteActions } from "@simpleapps-com/augur-server/testing";
137
-
138
- const { actions, mocks } = createMockSiteActions();
139
-
140
- // Setup return values
141
- mocks.pricing.getItemPrice.mockResolvedValue({ price: 9.99 });
142
-
143
- // Pass actions to your component/server action
144
- const price = await actions.pricing.getItemPrice("ITEM-1");
145
-
146
- // Assert calls
147
- expect(mocks.pricing.getItemPrice.mock.calls[0]).toEqual(["ITEM-1"]);
148
- ```
149
-
150
- ### createServerSite
151
-
152
- ```ts
153
- import { AugurApi } from "@simpleapps-com/augur-api";
154
- import { createServerSite } from "@simpleapps-com/augur-server";
155
-
156
- const api = new AugurApi({ baseUrl: process.env.AUGUR_API_URL! });
157
- export const site = createServerSite(api, {
158
- defaultCustomerId: "12345",
159
- auth: { secret: process.env.AUTH_SECRET },
160
- });
161
- ```
162
-
163
- ### createServerQueryProxy
164
-
165
- ```tsx
166
- import { createServerQueryProxy } from "@simpleapps-com/augur-server/hooks";
167
-
168
- const q = createServerQueryProxy();
169
-
170
- // Reads — any SDK method, routed through server actions
171
- const { data: item } = useQuery(q.items.invMast.doc.get(42));
172
- const { data: price } = useQuery(q.pricing.priceEngine.get({ itemId, customerId }));
173
-
174
- // Infinite queries — spread and add infinite-specific options
175
- const { data, fetchNextPage } = useInfiniteQuery({
176
- ...q.items.itemCategory.categoryItems.get(uid, filters),
177
- getNextPageParam: (lastPage) => lastPage.nextCursor,
178
- initialPageParam: 0,
179
- });
180
-
181
- // Mutations — write methods return mutation options
182
- const addToCart = useMutation(q.commerce.cartLine.add.create());
183
- ```
184
-
185
- ### createAugurApiHandler
186
-
187
- ```ts
188
- // app/api/augur/route.ts
189
- import { createAugurApiHandler } from "@simpleapps-com/augur-server/api";
190
-
191
- const handler = createAugurApiHandler();
192
- export const POST = handler;
37
+ ```bash
38
+ pnpm -C repo/packages/augur-server test
39
+ pnpm -C repo/packages/augur-server proofs
193
40
  ```
194
41
 
195
- ## Types
196
-
197
- `PaginatedResult`, `SiteActions`, `SiteActionsConfig`, `AugurAuthCallbacks`, `AugurAuthClient`, `AugurJWT`, `AugurSession`, `AugurUser`, `CreateAuthConfigOptions`, `QueryOptionsConfig`, `MockFn`, `MockSiteActions`, `MockSiteActionsResult`, `ServerSite`, `ServerSiteAuthConfig`, `ServerSiteConfig`
198
-
199
-
200
- ## Related Packages
201
-
202
- All packages use fixed versioning -- same version number across the platform.
203
-
204
- | Package | Description |
205
- |---------|-------------|
206
- | `@simpleapps-com/augur-config` | Shared tooling configuration presets for Augur ecommerce sites |
207
- | `@simpleapps-com/augur-core` | Universal foundation for Augur packages — proxy infrastructure, cache keys, method classification, shared types |
208
- | `@simpleapps-com/augur-hooks` | Cross-platform React Query hooks and Zustand stores for Augur ecommerce sites |
209
- | `@simpleapps-com/augur-mobile` | React Native/Expo adapters for Augur ecommerce apps (offline sync, biometrics, push) |
210
- | `@simpleapps-com/augur-tailwind` | Shared Tailwind CSS v4 theme with HSL variables for Augur ecommerce sites |
211
- | `@simpleapps-com/augur-utils` | Shared types, cache configuration, and utility functions for Augur ecommerce sites |
212
- | `@simpleapps-com/augur-web` | Shared React UI components for Augur ecommerce sites (Radix + Tailwind) |
42
+ A change to its exports MUST come with `pnpm -C repo/sites/augur-build generate` (the drift
43
+ test fails otherwise), and the guide changes in the same PR.
@@ -0,0 +1,44 @@
1
+ import type { AugurAPI } from "@simpleapps-com/augur-api";
2
+ import type { Seconds } from "../duration";
3
+ import type { EdgeCacheValue, ListResult } from "../sdk-call";
4
+ /** Derived from augur-api SDK — keeps types in sync automatically. */
5
+ export type AgrInfoApiClient = Pick<AugurAPI, "agrInfo">;
6
+ export interface AgrInfoActionsConfig {
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
+ /** CDN edge cache for rarely-changing data. Default: 8 (hours). */
12
+ longEdgeCache?: EdgeCacheValue;
13
+ /** Redis TTL in seconds. Default: 3600 (1 hour). */
14
+ redisTtl?: Seconds;
15
+ /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
16
+ longRedisTtl?: Seconds;
17
+ }
18
+ export interface AgrInfoActions {
19
+ getContext: (params?: Record<string, unknown>) => Promise<ListResult>;
20
+ getRubrics: (params?: Record<string, unknown>) => Promise<ListResult>;
21
+ getMicroservices: (params?: Record<string, unknown>) => Promise<ListResult>;
22
+ generateAkasha: (data?: Record<string, unknown>) => Promise<unknown | undefined>;
23
+ generateJoomla: (data?: Record<string, unknown>) => Promise<unknown | undefined>;
24
+ }
25
+ /**
26
+ * Creates server-side AGR Info actions with Redis caching and edge cache support.
27
+ *
28
+ * Covers the AGR Info microservice endpoints: context, rubrics,
29
+ * microservices, and AI generation (akasha/joomla).
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * import { createAgrInfoActions } from "@simpleapps-com/augur-server";
34
+ * import { getAugurClient } from "./augur-client";
35
+ *
36
+ * export const agrInfoActions = createAgrInfoActions(getAugurClient(), {
37
+ * cachePrefix: "example:",
38
+ * });
39
+ *
40
+ * const rubrics = await agrInfoActions.getRubrics();
41
+ * const result = await agrInfoActions.generateAkasha({ prompt: "Hello" });
42
+ * ``` */
43
+ export declare function createAgrInfoActions(api: AgrInfoApiClient, config?: AgrInfoActionsConfig): AgrInfoActions;
44
+ //# sourceMappingURL=agr-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agr-info.d.ts","sourceRoot":"","sources":["../../src/actions/agr-info.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,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,mEAAmE;IACnE,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,cAAc;IAC7B,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACtE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACtE,gBAAgB,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5E,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACjF,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CAClF;AAED;;;;;;;;;;;;;;;;;SAiBS;AACT,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EACrB,MAAM,GAAE,oBAAyB,GAChC,cAAc,CAmFhB"}
@@ -0,0 +1,38 @@
1
+ import type { AgrSiteTypes, AugurAPI } from "@simpleapps-com/augur-api";
2
+ import type { Seconds } from "../duration";
3
+ import type { EdgeCacheValue, ListResult } from "../sdk-call";
4
+ /** Derived from augur-api SDK — keeps types in sync automatically. */
5
+ 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
+ }
14
+ export interface AgrSiteActions {
15
+ getSettings: (serviceName: string) => Promise<ListResult>;
16
+ /** The site's generated robots.txt (`{ content, contentType }`). Replaces `getMetaFiles`. */
17
+ getRobots: () => Promise<AgrSiteTypes.MetaFilesRobotsListData>;
18
+ }
19
+ /**
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.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { createAgrSiteActions } from "@simpleapps-com/augur-server";
28
+ * import { getAugurClient } from "./augur-client";
29
+ *
30
+ * export const agrSiteActions = createAgrSiteActions(getAugurClient(), {
31
+ * cachePrefix: "example:",
32
+ * });
33
+ *
34
+ * const settings = await agrSiteActions.getSettings("my-service");
35
+ * const robots = await agrSiteActions.getRobots();
36
+ * ``` */
37
+ export declare function createAgrSiteActions(api: AgrSiteApiClient, config?: AgrSiteActionsConfig): AgrSiteActions;
38
+ //# sourceMappingURL=agr-site.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,29 @@
1
+ import type { AugurAPI, HealthCheckData, PingData } from "@simpleapps-com/augur-api";
2
+ /** Derived from augur-api SDK — keeps types in sync automatically. */
3
+ export type AgrWorkApiClient = Pick<AugurAPI, "agrWork">;
4
+ export interface AgrWorkActionsConfig {
5
+ /** Cache key prefix (e.g. "example:"). Default: "". */
6
+ cachePrefix?: string;
7
+ }
8
+ export interface AgrWorkActions {
9
+ healthCheck: () => Promise<HealthCheckData | undefined>;
10
+ ping: () => Promise<PingData | undefined>;
11
+ }
12
+ /**
13
+ * Creates server-side AGR Work actions for health monitoring and connectivity.
14
+ *
15
+ * Covers the AGR Work microservice endpoints: healthCheck and ping.
16
+ * These are real-time operations and do not use caching.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * import { createAgrWorkActions } from "@simpleapps-com/augur-server";
21
+ * import { getAugurClient } from "./augur-client";
22
+ *
23
+ * export const agrWorkActions = createAgrWorkActions(getAugurClient());
24
+ *
25
+ * const health = await agrWorkActions.healthCheck();
26
+ * const pong = await agrWorkActions.ping();
27
+ * ``` */
28
+ export declare function createAgrWorkActions(api: AgrWorkApiClient, _config?: AgrWorkActionsConfig): AgrWorkActions;
29
+ //# sourceMappingURL=agr-work.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agr-work.d.ts","sourceRoot":"","sources":["../../src/actions/agr-work.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErF,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;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IACxD,IAAI,EAAE,MAAM,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;SAeS;AACT,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EACrB,OAAO,GAAE,oBAAyB,GACjC,cAAc,CAuBhB"}
@@ -0,0 +1,38 @@
1
+ import type { AugurAPI, AvalaraTypes } from "@simpleapps-com/augur-api";
2
+ /** Derived from augur-api SDK — keeps types in sync automatically. */
3
+ export type AvalaraApiClient = Pick<AugurAPI, "avalara">;
4
+ export interface AvalaraActionsConfig {
5
+ /** Cache key prefix (e.g. "example:"). Default: "". */
6
+ cachePrefix?: string;
7
+ }
8
+ export interface AvalaraActions {
9
+ calculateTax: (data: AvalaraTypes.RatesCreateBody) => Promise<AvalaraTypes.RatesCreateData>;
10
+ }
11
+ /**
12
+ * Creates server-side Avalara actions for real-time tax calculation.
13
+ *
14
+ * Note: Tax calculation is a real-time operation and does NOT use caching.
15
+ * Each call hits the Avalara API directly to ensure up-to-date tax rates.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * import { createAvalaraActions } from "@simpleapps-com/augur-server";
20
+ * import { getAugurClient } from "./augur-client";
21
+ *
22
+ * export const avalaraActions = createAvalaraActions(getAugurClient());
23
+ *
24
+ * const totalTax = await avalaraActions.calculateTax({
25
+ * address: {
26
+ * line1: "123 Main St",
27
+ * line2: "",
28
+ * line3: "",
29
+ * city: "Irvine",
30
+ * region: "CA",
31
+ * postalCode: "92602",
32
+ * countryCode: "US",
33
+ * },
34
+ * items: [{ itemCode: "WIDGET", quantity: 1, amount: 100.0, taxCode: "" }],
35
+ * });
36
+ * ``` */
37
+ export declare function createAvalaraActions(api: AvalaraApiClient, _config?: AvalaraActionsConfig): AvalaraActions;
38
+ //# sourceMappingURL=avalara.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avalara.d.ts","sourceRoot":"","sources":["../../src/actions/avalara.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAExE,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;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,eAAe,KAAK,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;CAC7F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;SAyBS;AACT,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EAGrB,OAAO,GAAE,oBAAyB,GACjC,cAAc,CAWhB"}
@@ -0,0 +1,48 @@
1
+ import type { AugurAPI, Basecamp2Types } from "@simpleapps-com/augur-api";
2
+ import type { Seconds } from "../duration";
3
+ import type { EdgeCacheValue, ListResult } from "../sdk-call";
4
+ /** Derived from augur-api SDK — keeps types in sync automatically. */
5
+ export type Basecamp2ApiClient = Pick<AugurAPI, "basecamp2">;
6
+ export interface Basecamp2ActionsConfig {
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
+ /** CDN edge cache for rarely-changing data like people. Default: 8 (hours). */
12
+ longEdgeCache?: EdgeCacheValue;
13
+ /** Redis TTL in seconds. Default: 3600 (1 hour). */
14
+ redisTtl?: Seconds;
15
+ /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
16
+ longRedisTtl?: Seconds;
17
+ }
18
+ export interface Basecamp2Actions {
19
+ getTodos: (params?: Basecamp2Types.TodosListParams) => Promise<ListResult>;
20
+ getTodo: (todoId: number) => Promise<unknown>;
21
+ getTodosSummary: (params?: Basecamp2Types.TodosSummaryListParams) => Promise<ListResult>;
22
+ getComments: (params?: Basecamp2Types.CommentsListParams) => Promise<ListResult>;
23
+ getPeople: (params?: Basecamp2Types.PeopleListParams) => Promise<ListResult>;
24
+ getProjects: (params?: Basecamp2Types.ProjectsListParams) => Promise<ListResult>;
25
+ getEvents: (params?: Basecamp2Types.EventsListParams) => Promise<ListResult>;
26
+ getMetrics: (params?: Basecamp2Types.MetricsListParams) => Promise<ListResult>;
27
+ getTodolists: (params?: Basecamp2Types.TodolistsListParams) => Promise<ListResult>;
28
+ }
29
+ /**
30
+ * Creates server-side basecamp2 actions with Redis caching and edge cache support.
31
+ *
32
+ * Covers the Basecamp2 project management endpoints: todos, todo summaries,
33
+ * comments, people, projects, events, metrics, and todolists.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { createBasecamp2Actions } from "@simpleapps-com/augur-server";
38
+ * import { getAugurClient } from "./augur-client";
39
+ *
40
+ * export const basecamp2Actions = createBasecamp2Actions(getAugurClient(), {
41
+ * cachePrefix: "example:",
42
+ * });
43
+ *
44
+ * const todos = await basecamp2Actions.getTodos();
45
+ * const people = await basecamp2Actions.getPeople();
46
+ * ``` */
47
+ export declare function createBasecamp2Actions(api: Basecamp2ApiClient, config?: Basecamp2ActionsConfig): Basecamp2Actions;
48
+ //# sourceMappingURL=basecamp2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basecamp2.d.ts","sourceRoot":"","sources":["../../src/actions/basecamp2.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,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,+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,gBAAgB;IAC/B,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,eAAe,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3E,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,sBAAsB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACzF,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,kBAAkB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACjF,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,gBAAgB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7E,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,kBAAkB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACjF,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,gBAAgB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7E,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,iBAAiB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/E,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,mBAAmB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACpF;AAED;;;;;;;;;;;;;;;;;SAiBS;AACT,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,kBAAkB,EACvB,MAAM,GAAE,sBAA2B,GAClC,gBAAgB,CA8IlB"}