@oxyhq/core 3.17.0 → 3.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.
@@ -35,11 +35,15 @@ export function OxyServicesLinksMixin(Base) {
35
35
  * Resolve multiple link previews via `POST /links/previews` (body `{ urls }`).
36
36
  *
37
37
  * Inputs are de-duplicated and split into chunks of {@link LINK_PREVIEWS_CHUNK_SIZE}
38
- * (the server-side cap). Chunks run concurrently and their `data` maps are
38
+ * (the server-side cap). Chunks run concurrently and their result maps are
39
39
  * merged into a single result keyed by the REQUESTED url (the exact string
40
40
  * passed in `urls`) — matching the batch contract — so a caller can always
41
41
  * look its own input back up.
42
42
  *
43
+ * `makeRequest` unwraps the API's top-level `{ data }` envelope (same as
44
+ * `getUsersByIds`'s `makeServiceRequest<User[]>`), so each chunk response is
45
+ * already the `Record<url, LinkPreview>` map — merge it directly.
46
+ *
43
47
  * An empty / whitespace-only input resolves immediately with `{}` and
44
48
  * performs no network call. A failure in any chunk surfaces (via
45
49
  * `handleError`) rather than being swallowed.
@@ -55,7 +59,7 @@ export function OxyServicesLinksMixin(Base) {
55
59
  }
56
60
  try {
57
61
  const responses = await Promise.all(chunks.map((chunk) => this.makeRequest('POST', '/links/previews', { urls: chunk }, { cache: false })));
58
- return responses.reduce((merged, response) => Object.assign(merged, response?.data ?? {}), {});
62
+ return responses.reduce((merged, response) => Object.assign(merged, response ?? {}), {});
59
63
  }
60
64
  catch (error) {
61
65
  throw this.handleError(error);