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