@expandai/sdk 0.16.0 → 0.17.1

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 (360) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +83 -307
  3. package/build/dts/Client.d.ts +61 -0
  4. package/build/dts/Client.d.ts.map +1 -0
  5. package/build/dts/Error.d.ts +90 -0
  6. package/build/dts/Error.d.ts.map +1 -0
  7. package/build/dts/FetchJson.d.ts +364 -0
  8. package/build/dts/FetchJson.d.ts.map +1 -0
  9. package/build/dts/Generated.d.ts +1863 -0
  10. package/build/dts/Generated.d.ts.map +1 -0
  11. package/build/dts/HttpClientHelpers.d.ts +5 -0
  12. package/build/dts/HttpClientHelpers.d.ts.map +1 -0
  13. package/build/dts/Internal.d.ts +49 -0
  14. package/build/dts/Internal.d.ts.map +1 -0
  15. package/build/dts/Playground.d.ts +24 -0
  16. package/build/dts/Playground.d.ts.map +1 -0
  17. package/build/dts/Service.d.ts +277 -0
  18. package/build/dts/Service.d.ts.map +1 -0
  19. package/build/dts/index.d.ts +6 -0
  20. package/build/dts/index.d.ts.map +1 -0
  21. package/build/esm/Client.js +87 -0
  22. package/build/esm/Client.js.map +1 -0
  23. package/build/esm/Error.js +91 -0
  24. package/build/esm/Error.js.map +1 -0
  25. package/build/esm/FetchJson.js +70 -0
  26. package/build/esm/FetchJson.js.map +1 -0
  27. package/build/esm/Generated.js +646 -0
  28. package/build/esm/Generated.js.map +1 -0
  29. package/build/esm/HttpClientHelpers.js +14 -0
  30. package/build/esm/HttpClientHelpers.js.map +1 -0
  31. package/build/esm/Internal.js +95 -0
  32. package/build/esm/Internal.js.map +1 -0
  33. package/build/esm/Playground.js +55 -0
  34. package/build/esm/Playground.js.map +1 -0
  35. package/build/esm/Service.js +174 -0
  36. package/build/esm/Service.js.map +1 -0
  37. package/build/esm/index.js +4 -0
  38. package/build/esm/index.js.map +1 -0
  39. package/package.json +53 -136
  40. package/src/Client.ts +128 -0
  41. package/src/Error.ts +105 -0
  42. package/src/FetchJson.ts +109 -0
  43. package/src/Generated.ts +949 -0
  44. package/src/HttpClientHelpers.ts +24 -0
  45. package/src/Internal.ts +246 -0
  46. package/src/Playground.ts +76 -0
  47. package/src/Service.ts +264 -0
  48. package/src/index.ts +27 -21
  49. package/CHANGELOG.md +0 -224
  50. package/api-promise.d.mts +0 -2
  51. package/api-promise.d.mts.map +0 -1
  52. package/api-promise.d.ts +0 -2
  53. package/api-promise.d.ts.map +0 -1
  54. package/api-promise.js +0 -6
  55. package/api-promise.js.map +0 -1
  56. package/api-promise.mjs +0 -2
  57. package/api-promise.mjs.map +0 -1
  58. package/client.d.mts +0 -184
  59. package/client.d.mts.map +0 -1
  60. package/client.d.ts +0 -184
  61. package/client.d.ts.map +0 -1
  62. package/client.js +0 -476
  63. package/client.js.map +0 -1
  64. package/client.mjs +0 -472
  65. package/client.mjs.map +0 -1
  66. package/core/api-promise.d.mts +0 -46
  67. package/core/api-promise.d.mts.map +0 -1
  68. package/core/api-promise.d.ts +0 -46
  69. package/core/api-promise.d.ts.map +0 -1
  70. package/core/api-promise.js +0 -74
  71. package/core/api-promise.js.map +0 -1
  72. package/core/api-promise.mjs +0 -70
  73. package/core/api-promise.mjs.map +0 -1
  74. package/core/error.d.mts +0 -46
  75. package/core/error.d.mts.map +0 -1
  76. package/core/error.d.ts +0 -46
  77. package/core/error.d.ts.map +0 -1
  78. package/core/error.js +0 -113
  79. package/core/error.js.map +0 -1
  80. package/core/error.mjs +0 -97
  81. package/core/error.mjs.map +0 -1
  82. package/core/resource.d.mts +0 -6
  83. package/core/resource.d.mts.map +0 -1
  84. package/core/resource.d.ts +0 -6
  85. package/core/resource.d.ts.map +0 -1
  86. package/core/resource.js +0 -11
  87. package/core/resource.js.map +0 -1
  88. package/core/resource.mjs +0 -7
  89. package/core/resource.mjs.map +0 -1
  90. package/core/uploads.d.mts +0 -3
  91. package/core/uploads.d.mts.map +0 -1
  92. package/core/uploads.d.ts +0 -3
  93. package/core/uploads.d.ts.map +0 -1
  94. package/core/uploads.js +0 -6
  95. package/core/uploads.js.map +0 -1
  96. package/core/uploads.mjs +0 -2
  97. package/core/uploads.mjs.map +0 -1
  98. package/error.d.mts +0 -2
  99. package/error.d.mts.map +0 -1
  100. package/error.d.ts +0 -2
  101. package/error.d.ts.map +0 -1
  102. package/error.js +0 -6
  103. package/error.js.map +0 -1
  104. package/error.mjs +0 -2
  105. package/error.mjs.map +0 -1
  106. package/index.d.mts +0 -6
  107. package/index.d.mts.map +0 -1
  108. package/index.d.ts +0 -6
  109. package/index.d.ts.map +0 -1
  110. package/index.js +0 -30
  111. package/index.js.map +0 -1
  112. package/index.mjs +0 -7
  113. package/index.mjs.map +0 -1
  114. package/internal/builtin-types.d.mts +0 -73
  115. package/internal/builtin-types.d.mts.map +0 -1
  116. package/internal/builtin-types.d.ts +0 -73
  117. package/internal/builtin-types.d.ts.map +0 -1
  118. package/internal/builtin-types.js +0 -4
  119. package/internal/builtin-types.js.map +0 -1
  120. package/internal/builtin-types.mjs +0 -3
  121. package/internal/builtin-types.mjs.map +0 -1
  122. package/internal/detect-platform.d.mts +0 -15
  123. package/internal/detect-platform.d.mts.map +0 -1
  124. package/internal/detect-platform.d.ts +0 -15
  125. package/internal/detect-platform.d.ts.map +0 -1
  126. package/internal/detect-platform.js +0 -162
  127. package/internal/detect-platform.js.map +0 -1
  128. package/internal/detect-platform.mjs +0 -157
  129. package/internal/detect-platform.mjs.map +0 -1
  130. package/internal/errors.d.mts +0 -3
  131. package/internal/errors.d.mts.map +0 -1
  132. package/internal/errors.d.ts +0 -3
  133. package/internal/errors.d.ts.map +0 -1
  134. package/internal/errors.js +0 -41
  135. package/internal/errors.js.map +0 -1
  136. package/internal/errors.mjs +0 -36
  137. package/internal/errors.mjs.map +0 -1
  138. package/internal/headers.d.mts +0 -20
  139. package/internal/headers.d.mts.map +0 -1
  140. package/internal/headers.d.ts +0 -20
  141. package/internal/headers.d.ts.map +0 -1
  142. package/internal/headers.js +0 -79
  143. package/internal/headers.js.map +0 -1
  144. package/internal/headers.mjs +0 -74
  145. package/internal/headers.mjs.map +0 -1
  146. package/internal/parse.d.mts +0 -12
  147. package/internal/parse.d.mts.map +0 -1
  148. package/internal/parse.d.ts +0 -12
  149. package/internal/parse.d.ts.map +0 -1
  150. package/internal/parse.js +0 -40
  151. package/internal/parse.js.map +0 -1
  152. package/internal/parse.mjs +0 -37
  153. package/internal/parse.mjs.map +0 -1
  154. package/internal/request-options.d.mts +0 -75
  155. package/internal/request-options.d.mts.map +0 -1
  156. package/internal/request-options.d.ts +0 -75
  157. package/internal/request-options.d.ts.map +0 -1
  158. package/internal/request-options.js +0 -14
  159. package/internal/request-options.js.map +0 -1
  160. package/internal/request-options.mjs +0 -10
  161. package/internal/request-options.mjs.map +0 -1
  162. package/internal/shim-types.d.mts +0 -17
  163. package/internal/shim-types.d.mts.map +0 -1
  164. package/internal/shim-types.d.ts +0 -17
  165. package/internal/shim-types.d.ts.map +0 -1
  166. package/internal/shim-types.js +0 -4
  167. package/internal/shim-types.js.map +0 -1
  168. package/internal/shim-types.mjs +0 -3
  169. package/internal/shim-types.mjs.map +0 -1
  170. package/internal/shims.d.mts +0 -20
  171. package/internal/shims.d.mts.map +0 -1
  172. package/internal/shims.d.ts +0 -20
  173. package/internal/shims.d.ts.map +0 -1
  174. package/internal/shims.js +0 -92
  175. package/internal/shims.js.map +0 -1
  176. package/internal/shims.mjs +0 -85
  177. package/internal/shims.mjs.map +0 -1
  178. package/internal/to-file.d.mts +0 -45
  179. package/internal/to-file.d.mts.map +0 -1
  180. package/internal/to-file.d.ts +0 -45
  181. package/internal/to-file.d.ts.map +0 -1
  182. package/internal/to-file.js +0 -91
  183. package/internal/to-file.js.map +0 -1
  184. package/internal/to-file.mjs +0 -88
  185. package/internal/to-file.mjs.map +0 -1
  186. package/internal/tslib.js +0 -81
  187. package/internal/tslib.mjs +0 -17
  188. package/internal/types.d.mts +0 -69
  189. package/internal/types.d.mts.map +0 -1
  190. package/internal/types.d.ts +0 -69
  191. package/internal/types.d.ts.map +0 -1
  192. package/internal/types.js +0 -4
  193. package/internal/types.js.map +0 -1
  194. package/internal/types.mjs +0 -3
  195. package/internal/types.mjs.map +0 -1
  196. package/internal/uploads.d.mts +0 -42
  197. package/internal/uploads.d.mts.map +0 -1
  198. package/internal/uploads.d.ts +0 -42
  199. package/internal/uploads.d.ts.map +0 -1
  200. package/internal/uploads.js +0 -141
  201. package/internal/uploads.js.map +0 -1
  202. package/internal/uploads.mjs +0 -131
  203. package/internal/uploads.mjs.map +0 -1
  204. package/internal/utils/base64.d.mts +0 -3
  205. package/internal/utils/base64.d.mts.map +0 -1
  206. package/internal/utils/base64.d.ts +0 -3
  207. package/internal/utils/base64.d.ts.map +0 -1
  208. package/internal/utils/base64.js +0 -38
  209. package/internal/utils/base64.js.map +0 -1
  210. package/internal/utils/base64.mjs +0 -33
  211. package/internal/utils/base64.mjs.map +0 -1
  212. package/internal/utils/bytes.d.mts +0 -4
  213. package/internal/utils/bytes.d.mts.map +0 -1
  214. package/internal/utils/bytes.d.ts +0 -4
  215. package/internal/utils/bytes.d.ts.map +0 -1
  216. package/internal/utils/bytes.js +0 -31
  217. package/internal/utils/bytes.js.map +0 -1
  218. package/internal/utils/bytes.mjs +0 -26
  219. package/internal/utils/bytes.mjs.map +0 -1
  220. package/internal/utils/env.d.mts +0 -9
  221. package/internal/utils/env.d.mts.map +0 -1
  222. package/internal/utils/env.d.ts +0 -9
  223. package/internal/utils/env.d.ts.map +0 -1
  224. package/internal/utils/env.js +0 -22
  225. package/internal/utils/env.js.map +0 -1
  226. package/internal/utils/env.mjs +0 -18
  227. package/internal/utils/env.mjs.map +0 -1
  228. package/internal/utils/log.d.mts +0 -37
  229. package/internal/utils/log.d.mts.map +0 -1
  230. package/internal/utils/log.d.ts +0 -37
  231. package/internal/utils/log.d.ts.map +0 -1
  232. package/internal/utils/log.js +0 -86
  233. package/internal/utils/log.js.map +0 -1
  234. package/internal/utils/log.mjs +0 -80
  235. package/internal/utils/log.mjs.map +0 -1
  236. package/internal/utils/path.d.mts +0 -15
  237. package/internal/utils/path.d.mts.map +0 -1
  238. package/internal/utils/path.d.ts +0 -15
  239. package/internal/utils/path.d.ts.map +0 -1
  240. package/internal/utils/path.js +0 -79
  241. package/internal/utils/path.js.map +0 -1
  242. package/internal/utils/path.mjs +0 -74
  243. package/internal/utils/path.mjs.map +0 -1
  244. package/internal/utils/sleep.d.mts +0 -2
  245. package/internal/utils/sleep.d.mts.map +0 -1
  246. package/internal/utils/sleep.d.ts +0 -2
  247. package/internal/utils/sleep.d.ts.map +0 -1
  248. package/internal/utils/sleep.js +0 -7
  249. package/internal/utils/sleep.js.map +0 -1
  250. package/internal/utils/sleep.mjs +0 -3
  251. package/internal/utils/sleep.mjs.map +0 -1
  252. package/internal/utils/uuid.d.mts +0 -5
  253. package/internal/utils/uuid.d.mts.map +0 -1
  254. package/internal/utils/uuid.d.ts +0 -5
  255. package/internal/utils/uuid.d.ts.map +0 -1
  256. package/internal/utils/uuid.js +0 -19
  257. package/internal/utils/uuid.js.map +0 -1
  258. package/internal/utils/uuid.mjs +0 -15
  259. package/internal/utils/uuid.mjs.map +0 -1
  260. package/internal/utils/values.d.mts +0 -18
  261. package/internal/utils/values.d.mts.map +0 -1
  262. package/internal/utils/values.d.ts +0 -18
  263. package/internal/utils/values.d.ts.map +0 -1
  264. package/internal/utils/values.js +0 -112
  265. package/internal/utils/values.js.map +0 -1
  266. package/internal/utils/values.mjs +0 -94
  267. package/internal/utils/values.mjs.map +0 -1
  268. package/internal/utils.d.mts +0 -7
  269. package/internal/utils.d.mts.map +0 -1
  270. package/internal/utils.d.ts +0 -7
  271. package/internal/utils.d.ts.map +0 -1
  272. package/internal/utils.js +0 -11
  273. package/internal/utils.js.map +0 -1
  274. package/internal/utils.mjs +0 -8
  275. package/internal/utils.mjs.map +0 -1
  276. package/resource.d.mts +0 -2
  277. package/resource.d.mts.map +0 -1
  278. package/resource.d.ts +0 -2
  279. package/resource.d.ts.map +0 -1
  280. package/resource.js +0 -6
  281. package/resource.js.map +0 -1
  282. package/resource.mjs +0 -2
  283. package/resource.mjs.map +0 -1
  284. package/resources/index.d.mts +0 -2
  285. package/resources/index.d.mts.map +0 -1
  286. package/resources/index.d.ts +0 -2
  287. package/resources/index.d.ts.map +0 -1
  288. package/resources/index.js +0 -4
  289. package/resources/index.js.map +0 -1
  290. package/resources/index.mjs +0 -3
  291. package/resources/index.mjs.map +0 -1
  292. package/resources/top-level.d.mts +0 -468
  293. package/resources/top-level.d.mts.map +0 -1
  294. package/resources/top-level.d.ts +0 -468
  295. package/resources/top-level.d.ts.map +0 -1
  296. package/resources/top-level.js +0 -4
  297. package/resources/top-level.js.map +0 -1
  298. package/resources/top-level.mjs +0 -3
  299. package/resources/top-level.mjs.map +0 -1
  300. package/resources.d.mts +0 -2
  301. package/resources.d.mts.map +0 -1
  302. package/resources.d.ts +0 -2
  303. package/resources.d.ts.map +0 -1
  304. package/resources.js +0 -5
  305. package/resources.js.map +0 -1
  306. package/resources.mjs +0 -2
  307. package/resources.mjs.map +0 -1
  308. package/src/api-promise.ts +0 -2
  309. package/src/client.ts +0 -744
  310. package/src/core/README.md +0 -3
  311. package/src/core/api-promise.ts +0 -92
  312. package/src/core/error.ts +0 -130
  313. package/src/core/resource.ts +0 -11
  314. package/src/core/uploads.ts +0 -2
  315. package/src/error.ts +0 -2
  316. package/src/internal/README.md +0 -3
  317. package/src/internal/builtin-types.ts +0 -93
  318. package/src/internal/detect-platform.ts +0 -196
  319. package/src/internal/errors.ts +0 -33
  320. package/src/internal/headers.ts +0 -97
  321. package/src/internal/parse.ts +0 -56
  322. package/src/internal/request-options.ts +0 -91
  323. package/src/internal/shim-types.ts +0 -26
  324. package/src/internal/shims.ts +0 -107
  325. package/src/internal/to-file.ts +0 -154
  326. package/src/internal/types.ts +0 -95
  327. package/src/internal/uploads.ts +0 -187
  328. package/src/internal/utils/base64.ts +0 -40
  329. package/src/internal/utils/bytes.ts +0 -32
  330. package/src/internal/utils/env.ts +0 -18
  331. package/src/internal/utils/log.ts +0 -127
  332. package/src/internal/utils/path.ts +0 -88
  333. package/src/internal/utils/sleep.ts +0 -3
  334. package/src/internal/utils/uuid.ts +0 -17
  335. package/src/internal/utils/values.ts +0 -105
  336. package/src/internal/utils.ts +0 -8
  337. package/src/lib/.keep +0 -4
  338. package/src/resource.ts +0 -2
  339. package/src/resources/index.ts +0 -3
  340. package/src/resources/top-level.ts +0 -551
  341. package/src/resources.ts +0 -1
  342. package/src/tsconfig.json +0 -11
  343. package/src/uploads.ts +0 -2
  344. package/src/version.ts +0 -1
  345. package/uploads.d.mts +0 -2
  346. package/uploads.d.mts.map +0 -1
  347. package/uploads.d.ts +0 -2
  348. package/uploads.d.ts.map +0 -1
  349. package/uploads.js +0 -6
  350. package/uploads.js.map +0 -1
  351. package/uploads.mjs +0 -2
  352. package/uploads.mjs.map +0 -1
  353. package/version.d.mts +0 -2
  354. package/version.d.mts.map +0 -1
  355. package/version.d.ts +0 -2
  356. package/version.d.ts.map +0 -1
  357. package/version.js +0 -5
  358. package/version.js.map +0 -1
  359. package/version.mjs +0 -2
  360. package/version.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Generated.d.ts","sourceRoot":"","sources":["../../src/Generated.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,OAAO,KAAK,KAAK,UAAU,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,eAAe,MAAM,kCAAkC,CAAA;AAInE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,CAAC,MAAM,eAAe,CAAA;;;;;;AAElC,qBAAa,gBAAiB,SAAQ,qBAEpC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,IAAI,GAC3B,OAAO,aAAa,CAAC,IAAI,GACzB,OAAO,kBAAkB,CAAC,IAAI,CAChC,CAAA;IACD,QAAQ,CAAC,YAAY,EAAE,CACtB,OAAO,EAAE,OAAO,mBAAmB,CAAC,OAAO,KACvC,MAAM,CAAC,MAAM,CACjB,OAAO,UAAU,CAAC,IAAI,EACpB,eAAe,CAAC,eAAe,GAC/B,UAAU,GACV,OAAO,eAAe,CAAC,IAAI,GAC3B,OAAO,UAAU,CAAC,IAAI,GACtB,OAAO,eAAe,CAAC,IAAI,GAC3B,OAAO,eAAe,CAAC,IAAI,GAC3B,OAAO,eAAe,CAAC,IAAI,GAC3B,OAAO,aAAa,CAAC,IAAI,GACzB,OAAO,kBAAkB,CAAC,IAAI,CAChC,CAAA;IACD,QAAQ,CAAC,eAAe,EAAE,CACzB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,qBAAqB,CAAC,OAAO,KACzC,MAAM,CAAC,MAAM,CACjB,OAAO,aAAa,CAAC,IAAI,EACvB,eAAe,CAAC,eAAe,GAC/B,UAAU,GACV,OAAO,kBAAkB,CAAC,IAAI,GAC9B,OAAO,UAAU,CAAC,IAAI,GACtB,OAAO,eAAe,CAAC,IAAI,GAC3B,OAAO,eAAe,CAAC,IAAI,GAC3B,OAAO,aAAa,CAAC,IAAI,GACzB,OAAO,kBAAkB,CAAC,IAAI,CAChC,CAAA;CACD"}
@@ -0,0 +1,5 @@
1
+ import { HttpClientError, HttpClientRequest, HttpClientResponse } from '@effect/platform';
2
+ import { Effect, Schema } from 'effect';
3
+ export declare function unexpectedStatus(request: HttpClientRequest.HttpClientRequest, response: HttpClientResponse.HttpClientResponse): Effect.Effect<never, HttpClientError.ResponseError, never>;
4
+ export declare function decodeError<A, I, R>(response: HttpClientResponse.HttpClientResponse, schema: Schema.Schema<A, I, R>): Effect.Effect<never, HttpClientError.ResponseError | import("effect/ParseResult").ParseError | A, R>;
5
+ //# sourceMappingURL=HttpClientHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpClientHelpers.d.ts","sourceRoot":"","sources":["../../src/HttpClientHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEvC,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,iBAAiB,CAAC,iBAAiB,EAC5C,QAAQ,EAAE,kBAAkB,CAAC,kBAAkB,8DAc/C;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,wGAEnH"}
@@ -0,0 +1,49 @@
1
+ import { Cause, Effect, Layer } from 'effect';
2
+ import { ExpandClientError, type ExpandError, ExpandSdkError } from './Error.js';
3
+ import { type BatchedParams, type BatchedResponse, ExpandService, type ExpandServiceOptions, type FetchJsonParams, type FetchJsonResponse, type FetchParams, type FetchResponse, type FetchSearchParams, type FetchSearchResponse, type GetBatchedParams, type GetBatchedResponse, type RequestOptions } from './Service.js';
4
+ /**
5
+ * Lift a raw failure (HTTP error, parse error, codegen-typed error class, or unrelated throwable)
6
+ * into the typed `ExpandError` union surfaced by the SDK. Used by `ExpandService` to construct
7
+ * its public error channel.
8
+ */
9
+ export declare function toExpandError(error: unknown, timeoutMs: number): ExpandError;
10
+ /**
11
+ * Decide whether a failure should trigger a retry. Timeouts and connection errors are always
12
+ * retryable; API errors are retryable only for the standard transient status codes (408/409/429/5xx).
13
+ */
14
+ export declare function isRetryable(error: unknown, timeoutMs: number): boolean;
15
+ declare const InternalClient_base: Effect.Service.Class<InternalClient, "@expandai/sdk/InternalClient", {
16
+ readonly effect: Effect.Effect<{
17
+ readonly fetch: (params: FetchParams, options?: RequestOptions) => Effect.Effect<FetchResponse, ExpandClientError>;
18
+ readonly fetchJson: (params: FetchJsonParams, options?: RequestOptions) => Effect.Effect<FetchJsonResponse, ExpandClientError>;
19
+ readonly fetchSearch: (params: FetchSearchParams, options?: RequestOptions) => Effect.Effect<FetchSearchResponse, ExpandClientError>;
20
+ readonly batched: (params: BatchedParams, options?: RequestOptions) => Effect.Effect<BatchedResponse, ExpandClientError>;
21
+ readonly getBatched: (id: string, options?: GetBatchedParams & RequestOptions) => Effect.Effect<GetBatchedResponse, ExpandClientError>;
22
+ }, never, ExpandService>;
23
+ }>;
24
+ /**
25
+ * Effect-side bridge between {@link ExpandService} and the Promise-based {@link ExpandClient}.
26
+ *
27
+ * Exposes the same fetch/batched/getBatched methods as `ExpandService` but with the typed `ExpandError`
28
+ * channel mapped to the `ExpandClientError` hierarchy that async/await consumers expect. Not exported
29
+ * from the package — Effect consumers depend on `ExpandService` directly and receive the typed
30
+ * `ExpandError` unions as-is.
31
+ */
32
+ export declare class InternalClient extends InternalClient_base {
33
+ /**
34
+ * Build a Layer providing `InternalClient` (and its `ExpandService` dependency) from the given
35
+ * options. The layer can fail at acquisition with `ExpandSdkError` (propagated from
36
+ * `ExpandService.layer`'s validation); callers running this for a Promise wrapper should pipe
37
+ * through `translateCause`, which converts via `toPublicError` to the public `ExpandClientError`.
38
+ */
39
+ static layer(options?: ExpandServiceOptions): Layer.Layer<InternalClient, ExpandSdkError>;
40
+ /**
41
+ * Flatten an Effect failure cause into the value to throw from a Promise wrapper. Typed errors
42
+ * (`ExpandClientError`, `ExpandSdkError`) pass through `toPublicError` if available; non-failure
43
+ * causes (defects, interruption) get wrapped in a generic `ExpandClientError`.
44
+ */
45
+ static translateCause(cause: Cause.Cause<unknown>): unknown;
46
+ private static hasPublicErrorTranslator;
47
+ }
48
+ export {};
49
+ //# sourceMappingURL=Internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Internal.d.ts","sourceRoot":"","sources":["../../src/Internal.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C,KAAK,CAAC,cAAc,EAAE,cAAc,CAAC;IAI7F;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO;IAQ3D,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAQvC"}
@@ -0,0 +1,24 @@
1
+ export declare const DEFAULT_PLAYGROUND_HOST = "https://expand.land";
2
+ export type CitationSource = 'markdown' | 'appendix' | 'statejson';
3
+ /** Snippet location subset needed to build a deep link. Tolerates `null` and `undefined`. */
4
+ export interface CitationLocation {
5
+ readonly nodeIds?: ReadonlyArray<number> | null;
6
+ readonly stateJsonSourceId?: number | null;
7
+ }
8
+ /** Whole-snapshot URL: `${host}/s/${snapshotId}`. */
9
+ export declare function playgroundBase(snapshotId: string, host?: string): string;
10
+ /** Origin of a server-provided `meta.playground` URL, for reuse as the host (staging-safe). */
11
+ export declare function playgroundOrigin(metaPlayground: string): string;
12
+ /**
13
+ * Host to build citation links against: the origin of a server-provided `meta.playground`
14
+ * (authoritative, staging-safe) when present and parseable, else the caller's fallback.
15
+ */
16
+ export declare function resolvePlaygroundHost(metaPlayground: string | null | undefined, fallback: string): string;
17
+ /**
18
+ * Deep link auditing a single snippet:
19
+ * - `statejson` with a source id → `?id=<stateJsonSourceId>` (opens the JSON evidence object).
20
+ * - `markdown`/`appendix` with a node id → `/playground#focus=<nodeIds[0]>` (highlights the block).
21
+ * - otherwise → the whole-snapshot base URL.
22
+ */
23
+ export declare function citationUrl(snapshotId: string, source: CitationSource, location: CitationLocation | null | undefined, host?: string): string;
24
+ //# sourceMappingURL=Playground.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Playground.d.ts","sourceRoot":"","sources":["../../src/Playground.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,uBAAuB,wBAAwB,CAAA;AAE5D,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAA;AAElE,6FAA6F;AAC7F,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;IAC/C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1C;AAMD,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,MAAgC,GAAG,MAAM,CAEjG;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUzG;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,EAC7C,IAAI,GAAE,MAAgC,GACpC,MAAM,CAYR"}
@@ -0,0 +1,277 @@
1
+ import { HttpClient } from '@effect/platform';
2
+ import { Context, Effect, Layer, Schema } from 'effect';
3
+ import { ExpandSdkError } from './Error.js';
4
+ import { type FetchObjectModeResultWithJson, type FetchSnapshotSearchResultWithJson } from './FetchJson.js';
5
+ import * as Generated from './Generated.js';
6
+ declare const ExpandServiceOptions_base: Schema.Class<ExpandServiceOptions, {
7
+ /** API key. Falls back to the `EXPAND_API_KEY` environment variable. */
8
+ apiKey: Schema.optional<typeof Schema.String>;
9
+ /** API base URL. Defaults to `https://api.expand.ai`. */
10
+ baseUrl: Schema.optional<typeof Schema.String>;
11
+ /**
12
+ * Total wall-clock budget in milliseconds for the operation, including retries and backoff.
13
+ * Each attempt gets `timeoutMs / (maxRetries + 1)`. Defaults to 60_000.
14
+ */
15
+ timeoutMs: Schema.optional<typeof Schema.Number>;
16
+ /**
17
+ * Number of retry attempts for retryable failures (timeouts, connection errors, 408/409/429/5xx).
18
+ * Defaults to 2. Note: `batched()` defaults to 0 regardless of this setting; pass `{ maxRetries: N }`
19
+ * per-call to opt in.
20
+ */
21
+ maxRetries: Schema.optional<typeof Schema.Number>;
22
+ }, Schema.Struct.Encoded<{
23
+ /** API key. Falls back to the `EXPAND_API_KEY` environment variable. */
24
+ apiKey: Schema.optional<typeof Schema.String>;
25
+ /** API base URL. Defaults to `https://api.expand.ai`. */
26
+ baseUrl: Schema.optional<typeof Schema.String>;
27
+ /**
28
+ * Total wall-clock budget in milliseconds for the operation, including retries and backoff.
29
+ * Each attempt gets `timeoutMs / (maxRetries + 1)`. Defaults to 60_000.
30
+ */
31
+ timeoutMs: Schema.optional<typeof Schema.Number>;
32
+ /**
33
+ * Number of retry attempts for retryable failures (timeouts, connection errors, 408/409/429/5xx).
34
+ * Defaults to 2. Note: `batched()` defaults to 0 regardless of this setting; pass `{ maxRetries: N }`
35
+ * per-call to opt in.
36
+ */
37
+ maxRetries: Schema.optional<typeof Schema.Number>;
38
+ }>, never, {
39
+ readonly timeoutMs?: number | undefined;
40
+ } & {
41
+ readonly apiKey?: string | undefined;
42
+ } & {
43
+ readonly baseUrl?: string | undefined;
44
+ } & {
45
+ readonly maxRetries?: number | undefined;
46
+ }, {}, {}>;
47
+ /**
48
+ * Options accepted by `ExpandService.layer`. All fields are optional; defaults match `ExpandClient`.
49
+ */
50
+ export declare class ExpandServiceOptions extends ExpandServiceOptions_base {
51
+ }
52
+ declare const RequestOptions_base: Schema.Class<RequestOptions, {
53
+ /** Override the configured `timeoutMs` for this request. Total wall-clock budget across all attempts. */
54
+ timeoutMs: Schema.optional<typeof Schema.Number>;
55
+ /** Override the configured `maxRetries` for this request. */
56
+ maxRetries: Schema.optional<typeof Schema.Number>;
57
+ }, Schema.Struct.Encoded<{
58
+ /** Override the configured `timeoutMs` for this request. Total wall-clock budget across all attempts. */
59
+ timeoutMs: Schema.optional<typeof Schema.Number>;
60
+ /** Override the configured `maxRetries` for this request. */
61
+ maxRetries: Schema.optional<typeof Schema.Number>;
62
+ }>, never, {
63
+ readonly timeoutMs?: number | undefined;
64
+ } & {
65
+ readonly maxRetries?: number | undefined;
66
+ }, {}, {}>;
67
+ /**
68
+ * Per-request overrides accepted by `ExpandService.fetch`/`batched`/`getBatched` (and, transitively,
69
+ * by `ExpandClient`'s methods).
70
+ */
71
+ export declare class RequestOptions extends RequestOptions_base {
72
+ }
73
+ export type FetchParams = typeof Generated.FetchFetchRequest.Encoded;
74
+ export type FetchResponse = string;
75
+ export type FetchRequestOptions = RequestOptions & typeof Generated.FetchFetchParams.Encoded;
76
+ export type FetchJsonParams = typeof Generated.FetchFetchJsonRequest.Encoded;
77
+ export type FetchJsonResponse = FetchObjectModeResultWithJson;
78
+ export type FetchJsonRequestOptions = RequestOptions & typeof Generated.FetchFetchJsonParams.Encoded;
79
+ export type FetchSearchParams = typeof Generated.FetchFetchSearchRequest.Encoded;
80
+ export type FetchSearchResponse = FetchSnapshotSearchResultWithJson;
81
+ export type BatchedParams = typeof Generated.FetchBatchedRequest.Encoded;
82
+ export type BatchedResponse = typeof Generated.BatchedRun.Type;
83
+ export type GetBatchedParams = typeof Generated.FetchGetBatchedParams.Encoded;
84
+ export type GetBatchedResponse = typeof Generated.BatchedStatus.Type;
85
+ declare const ServiceConfig_base: Schema.Class<ServiceConfig, {
86
+ apiKey: typeof Schema.NonEmptyString;
87
+ baseUrl: typeof Schema.NonEmptyString;
88
+ timeoutMs: typeof Schema.Number;
89
+ maxRetries: typeof Schema.Number;
90
+ }, Schema.Struct.Encoded<{
91
+ apiKey: typeof Schema.NonEmptyString;
92
+ baseUrl: typeof Schema.NonEmptyString;
93
+ timeoutMs: typeof Schema.Number;
94
+ maxRetries: typeof Schema.Number;
95
+ }>, never, {
96
+ readonly timeoutMs: number;
97
+ } & {
98
+ readonly apiKey: string;
99
+ } & {
100
+ readonly baseUrl: string;
101
+ } & {
102
+ readonly maxRetries: number;
103
+ }, {}, {}>;
104
+ declare class ServiceConfig extends ServiceConfig_base {
105
+ }
106
+ declare const ServiceConfigTag_base: Context.TagClass<ServiceConfigTag, "@expandai/sdk/ExpandServiceConfig", ServiceConfig>;
107
+ declare class ServiceConfigTag extends ServiceConfigTag_base {
108
+ }
109
+ /**
110
+ * Validate user-supplied options into a fully-defaulted `ServiceConfig`. Reads
111
+ * `EXPAND_API_KEY` from `process.env` when `options.apiKey` is missing. Used by
112
+ * `ExpandService.layer` (Effect-typed Layer error channel) and by `ExpandClient`
113
+ * (eagerly via `Effect.runSync` to preserve sync-throw constructor semantics).
114
+ */
115
+ export declare const buildServiceConfig: (options: ExpandServiceOptions) => Effect.Effect<ServiceConfig, ExpandSdkError, never>;
116
+ declare const ExpandService_base: Effect.Service.Class<ExpandService, "@expandai/sdk/ExpandService", {
117
+ readonly dependencies: readonly [Layer.Layer<HttpClient.HttpClient, never, never>];
118
+ readonly effect: Effect.Effect<{
119
+ readonly fetch: (params: {
120
+ readonly url: string;
121
+ readonly include?: {
122
+ readonly html?: boolean | {
123
+ readonly [x: string]: unknown;
124
+ } | null | undefined;
125
+ readonly markdown?: boolean | {
126
+ readonly [x: string]: unknown;
127
+ } | null | undefined;
128
+ readonly screenshot?: boolean | {
129
+ readonly fullPage?: boolean | null | undefined;
130
+ } | null | undefined;
131
+ readonly summary?: boolean | {
132
+ readonly prompt?: string | null | undefined;
133
+ } | null | undefined;
134
+ readonly links?: boolean | {
135
+ readonly skipEmptyText?: boolean | null | undefined;
136
+ readonly includeNavigation?: boolean | null | undefined;
137
+ } | null | undefined;
138
+ readonly meta?: boolean | null | undefined;
139
+ readonly response?: boolean | null | undefined;
140
+ readonly json?: boolean | null | undefined;
141
+ readonly appendix?: boolean | null | undefined;
142
+ } | null | undefined;
143
+ readonly search?: {
144
+ readonly query: string;
145
+ readonly maxResults?: number | null | undefined;
146
+ readonly minScore?: number | null | undefined;
147
+ } | null | undefined;
148
+ readonly browserConfig?: {
149
+ readonly scrollFullPage?: boolean | null | undefined;
150
+ } | null | undefined;
151
+ }, requestOptions?: FetchRequestOptions | undefined) => Effect.Effect<string, import("./Error.js").ExpandError, never>;
152
+ readonly fetchJson: (params: {
153
+ readonly url: string;
154
+ readonly include?: {
155
+ readonly html?: boolean | {
156
+ readonly [x: string]: unknown;
157
+ } | null | undefined;
158
+ readonly markdown?: boolean | {
159
+ readonly [x: string]: unknown;
160
+ } | null | undefined;
161
+ readonly screenshot?: boolean | {
162
+ readonly fullPage?: boolean | null | undefined;
163
+ } | null | undefined;
164
+ readonly summary?: boolean | {
165
+ readonly prompt?: string | null | undefined;
166
+ } | null | undefined;
167
+ readonly links?: boolean | {
168
+ readonly skipEmptyText?: boolean | null | undefined;
169
+ readonly includeNavigation?: boolean | null | undefined;
170
+ } | null | undefined;
171
+ readonly meta?: boolean | null | undefined;
172
+ readonly response?: boolean | null | undefined;
173
+ readonly json?: boolean | null | undefined;
174
+ readonly appendix?: boolean | null | undefined;
175
+ } | null | undefined;
176
+ readonly search?: {
177
+ readonly query: string;
178
+ readonly maxResults?: number | null | undefined;
179
+ readonly minScore?: number | null | undefined;
180
+ } | null | undefined;
181
+ readonly browserConfig?: {
182
+ readonly scrollFullPage?: boolean | null | undefined;
183
+ } | null | undefined;
184
+ }, requestOptions?: FetchJsonRequestOptions | undefined) => Effect.Effect<FetchObjectModeResultWithJson, import("./Error.js").ExpandError, never>;
185
+ readonly fetchSearch: (params: {
186
+ readonly search: {
187
+ readonly query: string;
188
+ readonly maxResults?: number | null | undefined;
189
+ readonly minScore?: number | null | undefined;
190
+ };
191
+ readonly snapshotId: string;
192
+ readonly include?: {
193
+ readonly html?: boolean | {
194
+ readonly [x: string]: unknown;
195
+ } | null | undefined;
196
+ readonly markdown?: boolean | {
197
+ readonly [x: string]: unknown;
198
+ } | null | undefined;
199
+ readonly screenshot?: boolean | {
200
+ readonly fullPage?: boolean | null | undefined;
201
+ } | null | undefined;
202
+ readonly summary?: boolean | {
203
+ readonly prompt?: string | null | undefined;
204
+ } | null | undefined;
205
+ readonly links?: boolean | {
206
+ readonly sameDomainOnly?: boolean | null | undefined;
207
+ readonly includePatterns?: readonly string[] | null | undefined;
208
+ readonly excludePatterns?: readonly string[] | null | undefined;
209
+ } | null | undefined;
210
+ readonly meta?: boolean | null | undefined;
211
+ readonly response?: {
212
+ readonly includeHeaders?: boolean | null | undefined;
213
+ } | null | undefined;
214
+ readonly json?: boolean | null | undefined;
215
+ readonly appendix?: boolean | null | undefined;
216
+ } | null | undefined;
217
+ }, requestOptions?: RequestOptions | undefined) => Effect.Effect<FetchSnapshotSearchResultWithJson, import("./Error.js").ExpandError, never>;
218
+ readonly batched: (params: {
219
+ readonly urls: readonly [string, ...string[]];
220
+ readonly include?: {
221
+ readonly html?: boolean | {
222
+ readonly [x: string]: unknown;
223
+ } | null | undefined;
224
+ readonly markdown?: boolean | {
225
+ readonly [x: string]: unknown;
226
+ } | null | undefined;
227
+ readonly screenshot?: boolean | {
228
+ readonly fullPage?: boolean | null | undefined;
229
+ } | null | undefined;
230
+ readonly summary?: boolean | {
231
+ readonly prompt?: string | null | undefined;
232
+ } | null | undefined;
233
+ readonly links?: boolean | {
234
+ readonly sameDomainOnly?: boolean | null | undefined;
235
+ readonly includePatterns?: readonly string[] | null | undefined;
236
+ readonly excludePatterns?: readonly string[] | null | undefined;
237
+ } | null | undefined;
238
+ readonly meta?: boolean | null | undefined;
239
+ readonly response?: {
240
+ readonly includeHeaders?: boolean | null | undefined;
241
+ } | null | undefined;
242
+ readonly json?: boolean | null | undefined;
243
+ readonly appendix?: boolean | null | undefined;
244
+ } | null | undefined;
245
+ readonly browserConfig?: {
246
+ readonly scrollFullPage?: boolean | null | undefined;
247
+ } | null | undefined;
248
+ }, requestOptions?: RequestOptions | undefined) => Effect.Effect<Generated.BatchedRun, import("./Error.js").ExpandError, never>;
249
+ readonly getBatched: (id: string, options?: ({
250
+ readonly include?: string | null | undefined;
251
+ readonly limit?: string | null | undefined;
252
+ readonly offset?: string | null | undefined;
253
+ } & RequestOptions) | undefined) => Effect.Effect<Generated.BatchedStatus, import("./Error.js").ExpandError, never>;
254
+ }, never, HttpClient.HttpClient | ServiceConfigTag>;
255
+ }>;
256
+ /**
257
+ * Effect-native client for the Expand API. Mirrors the {@link ExpandClient} Promise interface —
258
+ * methods accept the same `RequestOptions` per-call overrides and return Effects with the typed
259
+ * `ExpandError` channel (`ExpandApiError | ExpandConnectionError | ExpandTimeoutError | ExpandSdkError`).
260
+ *
261
+ * @example
262
+ * ```ts
263
+ * const program = Effect.gen(function* () {
264
+ * const expand = yield* ExpandService
265
+ * return yield* expand.fetch({ url: 'https://example.com' })
266
+ * }).pipe(Effect.provide(ExpandService.layer({ apiKey: 'sk_...' })))
267
+ * ```
268
+ */
269
+ export declare class ExpandService extends ExpandService_base {
270
+ /**
271
+ * Build a Layer providing `ExpandService` with the given options. Validation (missing apiKey,
272
+ * Schema-rejected config) surfaces via the Layer's error channel as `ExpandSdkError`.
273
+ */
274
+ static layer(options?: ExpandServiceOptions): Layer.Layer<ExpandService, ExpandSdkError, never>;
275
+ }
276
+ export {};
277
+ //# sourceMappingURL=Service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../src/Service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyC,MAAM,kBAAkB,CAAA;AAEpF,OAAO,EAAE,OAAO,EAAY,MAAM,EAAQ,KAAK,EAAY,MAAM,EAAE,MAAM,QAAQ,CAAA;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EACN,KAAK,6BAA6B,EAClC,KAAK,iCAAiC,EAGtC,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;;IAazC,wEAAwE;;IAIxE,yDAAyD;;IAIzD;;;OAGG;;IAMH;;;;OAIG;;;IArBH,wEAAwE;;IAIxE,yDAAyD;;IAIzD;;;OAGG;;IAMH;;;;OAIG;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAc,SAAQ,kBAwHjC;IACD;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,GAAE,oBAAyB;CAO/C"}
@@ -0,0 +1,6 @@
1
+ export type { BatchedParams, BatchedResponse, ExpandClientOptions, FetchJsonParams, FetchJsonRequestOptions, FetchJsonResponse, FetchParams, FetchRequestOptions, FetchResponse, FetchSearchParams, FetchSearchResponse, GetBatchedParams, GetBatchedResponse, } from './Client.js';
2
+ export { ExpandClient } from './Client.js';
3
+ export type { ExpandError } from './Error.js';
4
+ export { ExpandApiError, ExpandClientApiError, ExpandClientConnectionError, ExpandClientError, ExpandClientTimeoutError, ExpandConnectionError, ExpandSdkError, ExpandTimeoutError, } from './Error.js';
5
+ export { ExpandService, ExpandServiceOptions, RequestOptions } from './Service.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EACN,cAAc,EACd,oBAAoB,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GAClB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,87 @@
1
+ import { Effect, Either, Exit, Layer } from 'effect';
2
+ import { InternalClient } from './Internal.js';
3
+ import { buildServiceConfig, } from './Service.js';
4
+ /**
5
+ * Promise-based client for the Expand API. Holds an {@link InternalClient} layer and runs Effects
6
+ * against it, translating typed failures into the `ExpandClient*Error` hierarchy that async/await
7
+ * consumers expect.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const client = new ExpandClient({ apiKey: 'sk_...' })
12
+ * const result = await client.fetch({ url: 'https://example.com' })
13
+ * ```
14
+ */
15
+ export class ExpandClient {
16
+ layer;
17
+ constructor(options = {}) {
18
+ // Eagerly validate so the Promise constructor matches the documented sync-throw contract.
19
+ // `buildServiceConfig` is a pure-sync Effect (env-var read + Schema.decode), so runSync is safe.
20
+ const result = Effect.runSync(buildServiceConfig(options).pipe(Effect.either));
21
+ if (Either.isLeft(result)) {
22
+ throw result.left.toPublicError();
23
+ }
24
+ // Validation passed; the layer's acquisition Effect re-runs the same logic, so it cannot fail.
25
+ // Layer.orDie narrows the error channel to `never` while keeping a die fallback as a defensive
26
+ // net (translateCause picks up dies via Cause.dieOption and converts via toPublicError).
27
+ this.layer = InternalClient.layer(options).pipe(Layer.orDie);
28
+ }
29
+ /**
30
+ * Fetch a URL through the Expand API.
31
+ *
32
+ * @throws {ExpandClientApiError} on 4xx/5xx responses
33
+ * @throws {ExpandClientTimeoutError} when the request exceeds `timeoutMs`
34
+ * @throws {ExpandClientConnectionError} on network failures
35
+ * @throws {ExpandClientError} for any other failure
36
+ */
37
+ async fetch(params, options = {}) {
38
+ return this.run((client) => client.fetch(params, options));
39
+ }
40
+ /**
41
+ * Fetch a URL through the object-mode endpoint.
42
+ *
43
+ * Returns `{ meta, markdown, json }`; use {@link fetch} for the raw markdown document.
44
+ */
45
+ async fetchJson(params, options = {}) {
46
+ return this.run((client) => client.fetchJson(params, options));
47
+ }
48
+ /**
49
+ * Search a previous Fetch response by `snapshotId` without starting a new capture.
50
+ */
51
+ async fetchSearch(params, options = {}) {
52
+ return this.run((client) => client.fetchSearch(params, options));
53
+ }
54
+ /**
55
+ * Kick off an asynchronous batched fetch over one or more URLs. Returns a batched-run ID that can
56
+ * be polled via {@link getBatched}.
57
+ *
58
+ * Retries are disabled by default. Pass `{ maxRetries: N }` to opt in.
59
+ *
60
+ * @throws {ExpandClientApiError} on 4xx/5xx responses
61
+ * @throws {ExpandClientTimeoutError} when the request exceeds `timeoutMs`
62
+ * @throws {ExpandClientConnectionError} on network failures
63
+ * @throws {ExpandClientError} for any other failure
64
+ */
65
+ async batched(params, options = {}) {
66
+ return this.run((client) => client.batched(params, options));
67
+ }
68
+ /**
69
+ * Fetch the status and accumulated results for a batched run previously started by {@link batched}.
70
+ *
71
+ * @throws {ExpandClientApiError} on 4xx/5xx responses
72
+ * @throws {ExpandClientTimeoutError} when the request exceeds `timeoutMs`
73
+ * @throws {ExpandClientConnectionError} on network failures
74
+ * @throws {ExpandClientError} for any other failure
75
+ */
76
+ async getBatched(id, options = {}) {
77
+ return this.run((client) => client.getBatched(id, options));
78
+ }
79
+ async run(body) {
80
+ const exit = await Effect.runPromiseExit(InternalClient.use(body).pipe(Effect.provide(this.layer)));
81
+ if (Exit.isSuccess(exit)) {
82
+ return exit.value;
83
+ }
84
+ throw InternalClient.translateCause(exit.cause);
85
+ }
86
+ }
87
+ //# sourceMappingURL=Client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Client.js","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAGN,kBAAkB,GAalB,MAAM,cAAc,CAAA;AAoBrB;;;;;;;;;;GAUG;AACH,MAAM,OAAO,YAAY;IACP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GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,EAAU,EAAE,UAA6C,EAAE;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;IAC5D,CAAC;IAEO,KAAK,CAAC,GAAG,CAAI,IAAqD;QACzE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACnG,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAA;QAClB,CAAC;QACD,MAAM,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAChD,CAAC;CACD"}
@@ -0,0 +1,91 @@
1
+ import { Schema } from 'effect';
2
+ /**
3
+ * Effect-side base error. Schema.TaggedError; Effect consumers receive these in the error channel.
4
+ */
5
+ export class ExpandSdkError extends Schema.TaggedError()('ExpandSdkError', {
6
+ message: Schema.String,
7
+ cause: Schema.optional(Schema.Defect),
8
+ }) {
9
+ toPublicError() {
10
+ return new ExpandClientError(this.message, { cause: this.cause });
11
+ }
12
+ }
13
+ /**
14
+ * Effect-side error for non-2xx API responses. Inspect `status` and `body` for details.
15
+ */
16
+ export class ExpandApiError extends Schema.TaggedError()('ExpandApiError', {
17
+ message: Schema.String,
18
+ status: Schema.Number,
19
+ body: Schema.optional(Schema.Unknown),
20
+ cause: Schema.optional(Schema.Defect),
21
+ }) {
22
+ toPublicError() {
23
+ return new ExpandClientApiError(this.message, { status: this.status, body: this.body, cause: this.cause });
24
+ }
25
+ }
26
+ /**
27
+ * Effect-side error when the SDK cannot reach the API (DNS, connection refused, socket reset, etc.).
28
+ */
29
+ export class ExpandConnectionError extends Schema.TaggedError()('ExpandConnectionError', {
30
+ message: Schema.String,
31
+ cause: Schema.optional(Schema.Defect),
32
+ }) {
33
+ toPublicError() {
34
+ return new ExpandClientConnectionError(this.message, { cause: this.cause });
35
+ }
36
+ }
37
+ /**
38
+ * Effect-side error when a request exceeds its configured `timeoutMs`.
39
+ */
40
+ export class ExpandTimeoutError extends Schema.TaggedError()('ExpandTimeoutError', {
41
+ message: Schema.String,
42
+ timeoutMs: Schema.Number,
43
+ cause: Schema.optional(Schema.Defect),
44
+ }) {
45
+ toPublicError() {
46
+ return new ExpandClientTimeoutError(this.message, { timeoutMs: this.timeoutMs, cause: this.cause });
47
+ }
48
+ }
49
+ /**
50
+ * Promise-side base class. Catch this to handle any failure thrown by `ExpandClient`.
51
+ */
52
+ export class ExpandClientError extends Error {
53
+ constructor(message, options = {}) {
54
+ super(message, options);
55
+ this.name = 'ExpandClientError';
56
+ }
57
+ }
58
+ /**
59
+ * Promise-side error for non-2xx API responses. Inspect `status` and `body` for details.
60
+ */
61
+ export class ExpandClientApiError extends ExpandClientError {
62
+ status;
63
+ body;
64
+ constructor(message, options) {
65
+ super(message, options);
66
+ this.name = 'ExpandClientApiError';
67
+ this.status = options.status;
68
+ this.body = options.body;
69
+ }
70
+ }
71
+ /**
72
+ * Promise-side error when the SDK cannot reach the API (DNS, connection refused, socket reset, etc.).
73
+ */
74
+ export class ExpandClientConnectionError extends ExpandClientError {
75
+ constructor(message, options = {}) {
76
+ super(message, options);
77
+ this.name = 'ExpandClientConnectionError';
78
+ }
79
+ }
80
+ /**
81
+ * Promise-side error when a request exceeds its configured `timeoutMs`.
82
+ */
83
+ export class ExpandClientTimeoutError extends ExpandClientConnectionError {
84
+ timeoutMs;
85
+ constructor(message, options) {
86
+ super(message, options);
87
+ this.name = 'ExpandClientTimeoutError';
88
+ this.timeoutMs = options.timeoutMs;
89
+ }
90
+ }
91
+ //# sourceMappingURL=Error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Error.js","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,WAAW,EAAkB,CAAC,gBAAgB,EAAE;IAC1F,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CACrC,CAAC;IACD,aAAa;QACZ,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IAClE,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,WAAW,EAAkB,CAAC,gBAAgB,EAAE;IAC1F,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CACrC,CAAC;IACD,aAAa;QACZ,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IAC3G,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,MAAM,CAAC,WAAW,EAAyB,CAAC,uBAAuB,EAAE;IAC/G,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,KAAK,EAAE,M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