@mercurjs/client 2.3.6-canary.8 → 2.3.6

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.
package/dist/index.d.mts CHANGED
@@ -11,6 +11,7 @@ type ChildKeys<T> = Exclude<keyof T, HttpMethod | "__esModule">;
11
11
  type ClientOptions = {
12
12
  baseUrl: string;
13
13
  fetchOptions?: RequestInit;
14
+ headers?: () => Record<string, string>;
14
15
  };
15
16
  type AddParamsToFn<Fn, TParams> = keyof TParams extends never ? Fn : Fn extends (input?: infer TInput) => infer TOutput ? (input: (TInput extends Record<string, any> ? Omit<TInput, 'fetchOptions'> : {}) & TParams & {
16
17
  fetchOptions?: RequestInit;
package/dist/index.mjs CHANGED
@@ -112,7 +112,7 @@ var toFormData = (payload) => {
112
112
  return formData;
113
113
  };
114
114
  function createClient(options) {
115
- const { baseUrl, fetchOptions: defaultFetchOptions } = options;
115
+ const { baseUrl, fetchOptions: defaultFetchOptions, headers: resolveHeaders } = options;
116
116
  return createRecursiveProxy((path, args) => {
117
117
  var _a;
118
118
  const action = path.pop();
@@ -153,7 +153,7 @@ function createClient(options) {
153
153
  if (!isMultipart) {
154
154
  defaultHeaders["Content-Type"] = "application/json";
155
155
  }
156
- const headers = new Headers(__spreadValues(__spreadValues(__spreadValues({}, defaultHeaders), defaultFetchOptions == null ? void 0 : defaultFetchOptions.headers), inputFetchOptions == null ? void 0 : inputFetchOptions.headers));
156
+ const headers = new Headers(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, defaultHeaders), defaultFetchOptions == null ? void 0 : defaultFetchOptions.headers), resolveHeaders == null ? void 0 : resolveHeaders()), inputFetchOptions == null ? void 0 : inputFetchOptions.headers));
157
157
  return fetch(url, __spreadProps(__spreadValues(__spreadValues({}, defaultFetchOptions), inputFetchOptions), {
158
158
  method,
159
159
  body,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/client",
3
- "version": "2.3.6-canary.8",
3
+ "version": "2.3.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",
@@ -39,7 +39,7 @@
39
39
  "qs": "^6.12.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@medusajs/framework": "2.21.0",
42
+ "@medusajs/framework": "2.21.2",
43
43
  "@types/qs": "^6.9.18",
44
44
  "tsup": "^8.5.0",
45
45
  "typescript": "5.9.3"