@scalemule/nextjs 0.1.39 → 0.1.40

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/client.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a8 as StorageAdapter, A as ApiError } from './index-Tq5WdDfS.mjs';
1
+ import { a8 as StorageAdapter, A as ApiError } from './index-Bv1m_qQ8.mjs';
2
2
 
3
3
  /**
4
4
  * ScaleMule API Client
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a8 as StorageAdapter, A as ApiError } from './index-Tq5WdDfS.js';
1
+ import { a8 as StorageAdapter, A as ApiError } from './index-Bv1m_qQ8.js';
2
2
 
3
3
  /**
4
4
  * ScaleMule API Client
package/dist/client.js CHANGED
@@ -12,9 +12,31 @@ var ScaleMuleApiError = class extends Error {
12
12
  this.code = error.code;
13
13
  this.field = error.field;
14
14
  this.status = status;
15
+ this.requestId = error.requestId;
16
+ this.traceId = error.traceId;
17
+ this.problem = error.problem;
15
18
  }
16
19
  };
17
20
 
21
+ // src/error-context.ts
22
+ function withErrorContext(error, responseData, headers) {
23
+ const enriched = { ...error };
24
+ const meta = responseData?.meta;
25
+ const requestId = meta?.request_id ?? headers?.get("x-request-id") ?? void 0;
26
+ if (requestId !== void 0 && enriched.requestId === void 0) {
27
+ enriched.requestId = requestId;
28
+ }
29
+ const traceId = meta?.trace_id;
30
+ if (traceId !== void 0 && enriched.traceId === void 0) {
31
+ enriched.traceId = traceId;
32
+ }
33
+ const rawError = responseData?.error;
34
+ if (rawError !== null && typeof rawError === "object" && enriched.problem === void 0) {
35
+ enriched.problem = rawError;
36
+ }
37
+ return enriched;
38
+ }
39
+
18
40
  // src/client.ts
19
41
  var GATEWAY_URLS = {
20
42
  dev: "https://api-dev.scalemule.com",
@@ -591,7 +613,8 @@ var ScaleMuleClient = class {
591
613
  }
592
614
  if (!response.ok) {
593
615
  const rawError = responseData?.error;
594
- const error = rawError && typeof rawError === "object" ? rawError : { code: `HTTP_${response.status}`, message: typeof rawError === "string" ? rawError : responseData?.message || text || response.statusText };
616
+ const baseError = rawError && typeof rawError === "object" ? rawError : { code: `HTTP_${response.status}`, message: typeof rawError === "string" ? rawError : responseData?.message || text || response.statusText };
617
+ const error = withErrorContext(baseError, responseData, response.headers);
595
618
  if (response.status === 401 && this.sessionToken && !options.isAutoRefresh && refreshAttempts < MAX_REFRESH_ATTEMPTS) {
596
619
  refreshAttempts++;
597
620
  if (this.debug) console.log("[ScaleMule] 401 received, attempting auto-refresh...");
@@ -853,10 +876,17 @@ var ScaleMuleClient = class {
853
876
  const unwrapped = data?.data !== void 0 ? data.data : data;
854
877
  resolve(unwrapped);
855
878
  } else {
856
- reject(new ScaleMuleApiError(data?.error || {
879
+ const uploadError = data?.error || {
857
880
  code: `HTTP_${xhr.status}`,
858
881
  message: data?.message || xhr.responseText || "Upload failed"
859
- }));
882
+ };
883
+ reject(
884
+ new ScaleMuleApiError(
885
+ withErrorContext(uploadError, data, {
886
+ get: (name) => xhr.getResponseHeader(name)
887
+ })
888
+ )
889
+ );
860
890
  }
861
891
  } catch {
862
892
  reject(new ScaleMuleApiError({ code: "PARSE_ERROR", message: "Failed to parse response" }));
package/dist/client.mjs CHANGED
@@ -10,9 +10,31 @@ var ScaleMuleApiError = class extends Error {
10
10
  this.code = error.code;
11
11
  this.field = error.field;
12
12
  this.status = status;
13
+ this.requestId = error.requestId;
14
+ this.traceId = error.traceId;
15
+ this.problem = error.problem;
13
16
  }
14
17
  };
15
18
 
19
+ // src/error-context.ts
20
+ function withErrorContext(error, responseData, headers) {
21
+ const enriched = { ...error };
22
+ const meta = responseData?.meta;
23
+ const requestId = meta?.request_id ?? headers?.get("x-request-id") ?? void 0;
24
+ if (requestId !== void 0 && enriched.requestId === void 0) {
25
+ enriched.requestId = requestId;
26
+ }
27
+ const traceId = meta?.trace_id;
28
+ if (traceId !== void 0 && enriched.traceId === void 0) {
29
+ enriched.traceId = traceId;
30
+ }
31
+ const rawError = responseData?.error;
32
+ if (rawError !== null && typeof rawError === "object" && enriched.problem === void 0) {
33
+ enriched.problem = rawError;
34
+ }
35
+ return enriched;
36
+ }
37
+
16
38
  // src/client.ts
17
39
  var GATEWAY_URLS = {
18
40
  dev: "https://api-dev.scalemule.com",
@@ -589,7 +611,8 @@ var ScaleMuleClient = class {
589
611
  }
590
612
  if (!response.ok) {
591
613
  const rawError = responseData?.error;
592
- const error = rawError && typeof rawError === "object" ? rawError : { code: `HTTP_${response.status}`, message: typeof rawError === "string" ? rawError : responseData?.message || text || response.statusText };
614
+ const baseError = rawError && typeof rawError === "object" ? rawError : { code: `HTTP_${response.status}`, message: typeof rawError === "string" ? rawError : responseData?.message || text || response.statusText };
615
+ const error = withErrorContext(baseError, responseData, response.headers);
593
616
  if (response.status === 401 && this.sessionToken && !options.isAutoRefresh && refreshAttempts < MAX_REFRESH_ATTEMPTS) {
594
617
  refreshAttempts++;
595
618
  if (this.debug) console.log("[ScaleMule] 401 received, attempting auto-refresh...");
@@ -851,10 +874,17 @@ var ScaleMuleClient = class {
851
874
  const unwrapped = data?.data !== void 0 ? data.data : data;
852
875
  resolve(unwrapped);
853
876
  } else {
854
- reject(new ScaleMuleApiError(data?.error || {
877
+ const uploadError = data?.error || {
855
878
  code: `HTTP_${xhr.status}`,
856
879
  message: data?.message || xhr.responseText || "Upload failed"
857
- }));
880
+ };
881
+ reject(
882
+ new ScaleMuleApiError(
883
+ withErrorContext(uploadError, data, {
884
+ get: (name) => xhr.getResponseHeader(name)
885
+ })
886
+ )
887
+ );
858
888
  }
859
889
  } catch {
860
890
  reject(new ScaleMuleApiError({ code: "PARSE_ERROR", message: "Failed to parse response" }));
@@ -121,6 +121,20 @@ declare class ScaleMuleApiError extends Error {
121
121
  status?: number;
122
122
  field?: string;
123
123
  details?: unknown;
124
+ /**
125
+ * Correlation id for the failed request. Comes from the response envelope
126
+ * (`meta.request_id`), falling back to the `x-request-id` response header
127
+ * echoed by the gateway. Surface this in support flows.
128
+ */
129
+ requestId?: string;
130
+ /** Distributed-trace id, when the backend supplies `meta.trace_id`. */
131
+ traceId?: string;
132
+ /**
133
+ * The raw `error` object from the response body, unmodified. Escape hatch
134
+ * for consumers (such as `@scalemule/signals` `fromError`) that need fields
135
+ * this class does not model yet.
136
+ */
137
+ problem?: unknown;
124
138
  constructor(error: ApiError, status?: number);
125
139
  }
126
140
  interface ApiResponse<T> {
@@ -132,6 +146,12 @@ interface ApiError {
132
146
  code: string;
133
147
  message: string;
134
148
  field?: string;
149
+ /** Correlation id: envelope `meta.request_id`, else the `x-request-id` header. */
150
+ requestId?: string;
151
+ /** Distributed-trace id from envelope `meta.trace_id`. */
152
+ traceId?: string;
153
+ /** The raw body `error` object, passed through untouched. */
154
+ problem?: unknown;
135
155
  }
136
156
  interface User {
137
157
  id: string;
@@ -121,6 +121,20 @@ declare class ScaleMuleApiError extends Error {
121
121
  status?: number;
122
122
  field?: string;
123
123
  details?: unknown;
124
+ /**
125
+ * Correlation id for the failed request. Comes from the response envelope
126
+ * (`meta.request_id`), falling back to the `x-request-id` response header
127
+ * echoed by the gateway. Surface this in support flows.
128
+ */
129
+ requestId?: string;
130
+ /** Distributed-trace id, when the backend supplies `meta.trace_id`. */
131
+ traceId?: string;
132
+ /**
133
+ * The raw `error` object from the response body, unmodified. Escape hatch
134
+ * for consumers (such as `@scalemule/signals` `fromError`) that need fields
135
+ * this class does not model yet.
136
+ */
137
+ problem?: unknown;
124
138
  constructor(error: ApiError, status?: number);
125
139
  }
126
140
  interface ApiResponse<T> {
@@ -132,6 +146,12 @@ interface ApiError {
132
146
  code: string;
133
147
  message: string;
134
148
  field?: string;
149
+ /** Correlation id: envelope `meta.request_id`, else the `x-request-id` header. */
150
+ requestId?: string;
151
+ /** Distributed-trace id from envelope `meta.trace_id`. */
152
+ traceId?: string;
153
+ /** The raw body `error` object, passed through untouched. */
154
+ problem?: unknown;
135
155
  }
136
156
  interface User {
137
157
  id: string;
package/dist/index.d.mts CHANGED
@@ -6,8 +6,8 @@ import { MoneyClient } from '@scalemule/money';
6
6
  export { MoneyClient, MoneyClientConfig, createMoneyClient } from '@scalemule/money';
7
7
  import { ScaleMuleClient } from './client.mjs';
8
8
  export { ClientConfig, RequestOptions, createClient } from './client.mjs';
9
- import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError$1, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-Tq5WdDfS.mjs';
10
- export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, B as BatchTrackRequest, k as BillingPayment, l as BillingPayout, m as BillingRefund, n as BillingTransaction, C as ChangeEmailRequest, o as ChangePasswordRequest, p as ClientContext, q as ConnectedAccount, D as DeviceFingerprint, r as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, s as LinkedAccount, t as ListFilesResponse, u as LoginDeviceInfo, v as LoginRequest, w as LoginResponseWithMFA, x as LoginRiskInfo, M as MFAChallengeResponse, y as MFAMethod, z as MFASMSSetupResponse, G as MFASetupRequest, H as MFAStatus, I as MFATOTPSetupResponse, J as MFAVerifyRequest, O as OAuthCallbackRequest, N as OAuthCallbackResponse, P as OAuthConfig, Q as OAuthProvider, R as OAuthStartResponse, T as PageViewData, V as PayoutSchedule, W as PhoneLoginRequest, X as PhoneSendCodeRequest, Y as PhoneVerifyRequest, Z as Profile, _ as RefreshResponse, $ as RegisterRequest, a0 as ResetPasswordRequest, a1 as ScaleMuleApiError, a2 as ScaleMuleEnvironment, a3 as Session, a4 as SignedUploadCompleteRequest, a5 as SignedUploadRequest, a6 as SignedUploadResponse, a7 as SignedUploadUrl, a8 as StorageAdapter, a9 as StorageFile, aa as TrackEventResponse, ab as TransactionSummary, ac as UTMParams, ad as UpdateProfileRequest, ae as UploadOptions, af as UploadResponse, ag as VerifyEmailRequest } from './index-Tq5WdDfS.mjs';
9
+ import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError$1, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-Bv1m_qQ8.mjs';
10
+ export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, B as BatchTrackRequest, k as BillingPayment, l as BillingPayout, m as BillingRefund, n as BillingTransaction, C as ChangeEmailRequest, o as ChangePasswordRequest, p as ClientContext, q as ConnectedAccount, D as DeviceFingerprint, r as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, s as LinkedAccount, t as ListFilesResponse, u as LoginDeviceInfo, v as LoginRequest, w as LoginResponseWithMFA, x as LoginRiskInfo, M as MFAChallengeResponse, y as MFAMethod, z as MFASMSSetupResponse, G as MFASetupRequest, H as MFAStatus, I as MFATOTPSetupResponse, J as MFAVerifyRequest, O as OAuthCallbackRequest, N as OAuthCallbackResponse, P as OAuthConfig, Q as OAuthProvider, R as OAuthStartResponse, T as PageViewData, V as PayoutSchedule, W as PhoneLoginRequest, X as PhoneSendCodeRequest, Y as PhoneVerifyRequest, Z as Profile, _ as RefreshResponse, $ as RegisterRequest, a0 as ResetPasswordRequest, a1 as ScaleMuleApiError, a2 as ScaleMuleEnvironment, a3 as Session, a4 as SignedUploadCompleteRequest, a5 as SignedUploadRequest, a6 as SignedUploadResponse, a7 as SignedUploadUrl, a8 as StorageAdapter, a9 as StorageFile, aa as TrackEventResponse, ab as TransactionSummary, ac as UTMParams, ad as UpdateProfileRequest, ae as UploadOptions, af as UploadResponse, ag as VerifyEmailRequest } from './index-Bv1m_qQ8.mjs';
11
11
 
12
12
  /**
13
13
  * Tri-state file visibility — `'private' | 'app_public' | 'anonymous_visible'`.
package/dist/index.d.ts CHANGED
@@ -6,8 +6,8 @@ import { MoneyClient } from '@scalemule/money';
6
6
  export { MoneyClient, MoneyClientConfig, createMoneyClient } from '@scalemule/money';
7
7
  import { ScaleMuleClient } from './client.js';
8
8
  export { ClientConfig, RequestOptions, createClient } from './client.js';
9
- import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError$1, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-Tq5WdDfS.js';
10
- export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, B as BatchTrackRequest, k as BillingPayment, l as BillingPayout, m as BillingRefund, n as BillingTransaction, C as ChangeEmailRequest, o as ChangePasswordRequest, p as ClientContext, q as ConnectedAccount, D as DeviceFingerprint, r as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, s as LinkedAccount, t as ListFilesResponse, u as LoginDeviceInfo, v as LoginRequest, w as LoginResponseWithMFA, x as LoginRiskInfo, M as MFAChallengeResponse, y as MFAMethod, z as MFASMSSetupResponse, G as MFASetupRequest, H as MFAStatus, I as MFATOTPSetupResponse, J as MFAVerifyRequest, O as OAuthCallbackRequest, N as OAuthCallbackResponse, P as OAuthConfig, Q as OAuthProvider, R as OAuthStartResponse, T as PageViewData, V as PayoutSchedule, W as PhoneLoginRequest, X as PhoneSendCodeRequest, Y as PhoneVerifyRequest, Z as Profile, _ as RefreshResponse, $ as RegisterRequest, a0 as ResetPasswordRequest, a1 as ScaleMuleApiError, a2 as ScaleMuleEnvironment, a3 as Session, a4 as SignedUploadCompleteRequest, a5 as SignedUploadRequest, a6 as SignedUploadResponse, a7 as SignedUploadUrl, a8 as StorageAdapter, a9 as StorageFile, aa as TrackEventResponse, ab as TransactionSummary, ac as UTMParams, ad as UpdateProfileRequest, ae as UploadOptions, af as UploadResponse, ag as VerifyEmailRequest } from './index-Tq5WdDfS.js';
9
+ import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError$1, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-Bv1m_qQ8.js';
10
+ export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, B as BatchTrackRequest, k as BillingPayment, l as BillingPayout, m as BillingRefund, n as BillingTransaction, C as ChangeEmailRequest, o as ChangePasswordRequest, p as ClientContext, q as ConnectedAccount, D as DeviceFingerprint, r as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, s as LinkedAccount, t as ListFilesResponse, u as LoginDeviceInfo, v as LoginRequest, w as LoginResponseWithMFA, x as LoginRiskInfo, M as MFAChallengeResponse, y as MFAMethod, z as MFASMSSetupResponse, G as MFASetupRequest, H as MFAStatus, I as MFATOTPSetupResponse, J as MFAVerifyRequest, O as OAuthCallbackRequest, N as OAuthCallbackResponse, P as OAuthConfig, Q as OAuthProvider, R as OAuthStartResponse, T as PageViewData, V as PayoutSchedule, W as PhoneLoginRequest, X as PhoneSendCodeRequest, Y as PhoneVerifyRequest, Z as Profile, _ as RefreshResponse, $ as RegisterRequest, a0 as ResetPasswordRequest, a1 as ScaleMuleApiError, a2 as ScaleMuleEnvironment, a3 as Session, a4 as SignedUploadCompleteRequest, a5 as SignedUploadRequest, a6 as SignedUploadResponse, a7 as SignedUploadUrl, a8 as StorageAdapter, a9 as StorageFile, aa as TrackEventResponse, ab as TransactionSummary, ac as UTMParams, ad as UpdateProfileRequest, ae as UploadOptions, af as UploadResponse, ag as VerifyEmailRequest } from './index-Bv1m_qQ8.js';
11
11
 
12
12
  /**
13
13
  * Tri-state file visibility — `'private' | 'app_public' | 'anonymous_visible'`.
package/dist/index.js CHANGED
@@ -35,9 +35,31 @@ var ScaleMuleApiError = class extends Error {
35
35
  this.code = error.code;
36
36
  this.field = error.field;
37
37
  this.status = status;
38
+ this.requestId = error.requestId;
39
+ this.traceId = error.traceId;
40
+ this.problem = error.problem;
38
41
  }
39
42
  };
40
43
 
44
+ // src/error-context.ts
45
+ function withErrorContext(error, responseData, headers) {
46
+ const enriched = { ...error };
47
+ const meta = responseData?.meta;
48
+ const requestId = meta?.request_id ?? headers?.get("x-request-id") ?? void 0;
49
+ if (requestId !== void 0 && enriched.requestId === void 0) {
50
+ enriched.requestId = requestId;
51
+ }
52
+ const traceId = meta?.trace_id;
53
+ if (traceId !== void 0 && enriched.traceId === void 0) {
54
+ enriched.traceId = traceId;
55
+ }
56
+ const rawError = responseData?.error;
57
+ if (rawError !== null && typeof rawError === "object" && enriched.problem === void 0) {
58
+ enriched.problem = rawError;
59
+ }
60
+ return enriched;
61
+ }
62
+
41
63
  // src/client.ts
42
64
  var GATEWAY_URLS = {
43
65
  dev: "https://api-dev.scalemule.com",
@@ -614,7 +636,8 @@ var ScaleMuleClient = class {
614
636
  }
615
637
  if (!response.ok) {
616
638
  const rawError = responseData?.error;
617
- const error = rawError && typeof rawError === "object" ? rawError : { code: `HTTP_${response.status}`, message: typeof rawError === "string" ? rawError : responseData?.message || text || response.statusText };
639
+ const baseError = rawError && typeof rawError === "object" ? rawError : { code: `HTTP_${response.status}`, message: typeof rawError === "string" ? rawError : responseData?.message || text || response.statusText };
640
+ const error = withErrorContext(baseError, responseData, response.headers);
618
641
  if (response.status === 401 && this.sessionToken && !options.isAutoRefresh && refreshAttempts < MAX_REFRESH_ATTEMPTS) {
619
642
  refreshAttempts++;
620
643
  if (this.debug) console.log("[ScaleMule] 401 received, attempting auto-refresh...");
@@ -876,10 +899,17 @@ var ScaleMuleClient = class {
876
899
  const unwrapped = data?.data !== void 0 ? data.data : data;
877
900
  resolve(unwrapped);
878
901
  } else {
879
- reject(new ScaleMuleApiError(data?.error || {
902
+ const uploadError = data?.error || {
880
903
  code: `HTTP_${xhr.status}`,
881
904
  message: data?.message || xhr.responseText || "Upload failed"
882
- }));
905
+ };
906
+ reject(
907
+ new ScaleMuleApiError(
908
+ withErrorContext(uploadError, data, {
909
+ get: (name) => xhr.getResponseHeader(name)
910
+ })
911
+ )
912
+ );
883
913
  }
884
914
  } catch {
885
915
  reject(new ScaleMuleApiError({ code: "PARSE_ERROR", message: "Failed to parse response" }));
package/dist/index.mjs CHANGED
@@ -15,9 +15,31 @@ var ScaleMuleApiError = class extends Error {
15
15
  this.code = error.code;
16
16
  this.field = error.field;
17
17
  this.status = status;
18
+ this.requestId = error.requestId;
19
+ this.traceId = error.traceId;
20
+ this.problem = error.problem;
18
21
  }
19
22
  };
20
23
 
24
+ // src/error-context.ts
25
+ function withErrorContext(error, responseData, headers) {
26
+ const enriched = { ...error };
27
+ const meta = responseData?.meta;
28
+ const requestId = meta?.request_id ?? headers?.get("x-request-id") ?? void 0;
29
+ if (requestId !== void 0 && enriched.requestId === void 0) {
30
+ enriched.requestId = requestId;
31
+ }
32
+ const traceId = meta?.trace_id;
33
+ if (traceId !== void 0 && enriched.traceId === void 0) {
34
+ enriched.traceId = traceId;
35
+ }
36
+ const rawError = responseData?.error;
37
+ if (rawError !== null && typeof rawError === "object" && enriched.problem === void 0) {
38
+ enriched.problem = rawError;
39
+ }
40
+ return enriched;
41
+ }
42
+
21
43
  // src/client.ts
22
44
  var GATEWAY_URLS = {
23
45
  dev: "https://api-dev.scalemule.com",
@@ -594,7 +616,8 @@ var ScaleMuleClient = class {
594
616
  }
595
617
  if (!response.ok) {
596
618
  const rawError = responseData?.error;
597
- const error = rawError && typeof rawError === "object" ? rawError : { code: `HTTP_${response.status}`, message: typeof rawError === "string" ? rawError : responseData?.message || text || response.statusText };
619
+ const baseError = rawError && typeof rawError === "object" ? rawError : { code: `HTTP_${response.status}`, message: typeof rawError === "string" ? rawError : responseData?.message || text || response.statusText };
620
+ const error = withErrorContext(baseError, responseData, response.headers);
598
621
  if (response.status === 401 && this.sessionToken && !options.isAutoRefresh && refreshAttempts < MAX_REFRESH_ATTEMPTS) {
599
622
  refreshAttempts++;
600
623
  if (this.debug) console.log("[ScaleMule] 401 received, attempting auto-refresh...");
@@ -856,10 +879,17 @@ var ScaleMuleClient = class {
856
879
  const unwrapped = data?.data !== void 0 ? data.data : data;
857
880
  resolve(unwrapped);
858
881
  } else {
859
- reject(new ScaleMuleApiError(data?.error || {
882
+ const uploadError = data?.error || {
860
883
  code: `HTTP_${xhr.status}`,
861
884
  message: data?.message || xhr.responseText || "Upload failed"
862
- }));
885
+ };
886
+ reject(
887
+ new ScaleMuleApiError(
888
+ withErrorContext(uploadError, data, {
889
+ get: (name) => xhr.getResponseHeader(name)
890
+ })
891
+ )
892
+ );
863
893
  }
864
894
  } catch {
865
895
  reject(new ScaleMuleApiError({ code: "PARSE_ERROR", message: "Failed to parse response" }));
@@ -12,6 +12,9 @@ var ScaleMuleApiError = class extends Error {
12
12
  this.code = error.code;
13
13
  this.field = error.field;
14
14
  this.status = status;
15
+ this.requestId = error.requestId;
16
+ this.traceId = error.traceId;
17
+ this.problem = error.problem;
15
18
  }
16
19
  };
17
20
 
@@ -106,6 +109,25 @@ function buildClientContextHeaders(context) {
106
109
  return headers2;
107
110
  }
108
111
 
112
+ // src/error-context.ts
113
+ function withErrorContext(error, responseData, headers2) {
114
+ const enriched = { ...error };
115
+ const meta = responseData?.meta;
116
+ const requestId = meta?.request_id ?? headers2?.get("x-request-id") ?? void 0;
117
+ if (requestId !== void 0 && enriched.requestId === void 0) {
118
+ enriched.requestId = requestId;
119
+ }
120
+ const traceId = meta?.trace_id;
121
+ if (traceId !== void 0 && enriched.traceId === void 0) {
122
+ enriched.traceId = traceId;
123
+ }
124
+ const rawError = responseData?.error;
125
+ if (rawError !== null && typeof rawError === "object" && enriched.problem === void 0) {
126
+ enriched.problem = rawError;
127
+ }
128
+ return enriched;
129
+ }
130
+
109
131
  // src/server/client.ts
110
132
  var GATEWAY_URLS = {
111
133
  dev: "https://api-dev.scalemule.com",
@@ -525,7 +547,11 @@ var ScaleMuleServer = class {
525
547
  }
526
548
  if (!response.ok) {
527
549
  throw new ScaleMuleApiError(
528
- responseData?.error || { code: "UPLOAD_FAILED", message: text || "Upload failed" }
550
+ withErrorContext(
551
+ responseData?.error || { code: "UPLOAD_FAILED", message: text || "Upload failed" },
552
+ responseData,
553
+ response.headers
554
+ )
529
555
  );
530
556
  }
531
557
  const data = responseData?.data !== void 0 ? responseData.data : responseData;
@@ -768,10 +794,11 @@ var ScaleMuleServer = class {
768
794
  } catch {
769
795
  }
770
796
  if (!response.ok) {
771
- const error = responseData?.error || {
797
+ const baseError = responseData?.error || {
772
798
  code: `HTTP_${response.status}`,
773
799
  message: responseData?.message || text || response.statusText
774
800
  };
801
+ const error = withErrorContext(baseError, responseData, response.headers);
775
802
  if (response.status === 401 && options.sessionToken && !options.isAutoRefresh) {
776
803
  if (this.debug) console.log("[ScaleMule Server] 401 received, attempting auto-refresh...");
777
804
  try {
@@ -10,6 +10,9 @@ var ScaleMuleApiError = class extends Error {
10
10
  this.code = error.code;
11
11
  this.field = error.field;
12
12
  this.status = status;
13
+ this.requestId = error.requestId;
14
+ this.traceId = error.traceId;
15
+ this.problem = error.problem;
13
16
  }
14
17
  };
15
18
 
@@ -104,6 +107,25 @@ function buildClientContextHeaders(context) {
104
107
  return headers2;
105
108
  }
106
109
 
110
+ // src/error-context.ts
111
+ function withErrorContext(error, responseData, headers2) {
112
+ const enriched = { ...error };
113
+ const meta = responseData?.meta;
114
+ const requestId = meta?.request_id ?? headers2?.get("x-request-id") ?? void 0;
115
+ if (requestId !== void 0 && enriched.requestId === void 0) {
116
+ enriched.requestId = requestId;
117
+ }
118
+ const traceId = meta?.trace_id;
119
+ if (traceId !== void 0 && enriched.traceId === void 0) {
120
+ enriched.traceId = traceId;
121
+ }
122
+ const rawError = responseData?.error;
123
+ if (rawError !== null && typeof rawError === "object" && enriched.problem === void 0) {
124
+ enriched.problem = rawError;
125
+ }
126
+ return enriched;
127
+ }
128
+
107
129
  // src/server/client.ts
108
130
  var GATEWAY_URLS = {
109
131
  dev: "https://api-dev.scalemule.com",
@@ -523,7 +545,11 @@ var ScaleMuleServer = class {
523
545
  }
524
546
  if (!response.ok) {
525
547
  throw new ScaleMuleApiError(
526
- responseData?.error || { code: "UPLOAD_FAILED", message: text || "Upload failed" }
548
+ withErrorContext(
549
+ responseData?.error || { code: "UPLOAD_FAILED", message: text || "Upload failed" },
550
+ responseData,
551
+ response.headers
552
+ )
527
553
  );
528
554
  }
529
555
  const data = responseData?.data !== void 0 ? responseData.data : responseData;
@@ -766,10 +792,11 @@ var ScaleMuleServer = class {
766
792
  } catch {
767
793
  }
768
794
  if (!response.ok) {
769
- const error = responseData?.error || {
795
+ const baseError = responseData?.error || {
770
796
  code: `HTTP_${response.status}`,
771
797
  message: responseData?.message || text || response.statusText
772
798
  };
799
+ const error = withErrorContext(baseError, responseData, response.headers);
773
800
  if (response.status === 401 && options.sessionToken && !options.isAutoRefresh) {
774
801
  if (this.debug) console.log("[ScaleMule Server] 401 received, attempting auto-refresh...");
775
802
  try {
@@ -1,6 +1,6 @@
1
- import { S as ServerConfig } from '../webhook-handler-DN4WBjbm.mjs';
2
- export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-DN4WBjbm.mjs';
3
- import { p as ClientContext, A as ApiError } from '../index-Tq5WdDfS.mjs';
1
+ import { S as ServerConfig } from '../webhook-handler-CVmBvPFN.mjs';
2
+ export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-CVmBvPFN.mjs';
3
+ import { p as ClientContext, A as ApiError } from '../index-Bv1m_qQ8.mjs';
4
4
  export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.mjs';
5
5
  import { NextRequest, NextResponse } from 'next/server';
6
6
  import '@scalemule/money';
@@ -509,7 +509,21 @@ declare class ScaleMuleError extends Error {
509
509
  readonly code: string;
510
510
  readonly status: number;
511
511
  readonly details?: Record<string, unknown> | undefined;
512
- constructor(code: string, message: string, status?: number, details?: Record<string, unknown> | undefined);
512
+ /**
513
+ * Correlation id of the upstream platform request that produced this
514
+ * error, when there was one. `apiHandler()` echoes it back to the browser
515
+ * as `meta.request_id` so a client-side failure can be traced all the way
516
+ * through the route handler to the platform service.
517
+ */
518
+ readonly requestId?: string | undefined;
519
+ constructor(code: string, message: string, status?: number, details?: Record<string, unknown> | undefined,
520
+ /**
521
+ * Correlation id of the upstream platform request that produced this
522
+ * error, when there was one. `apiHandler()` echoes it back to the browser
523
+ * as `meta.request_id` so a client-side failure can be traced all the way
524
+ * through the route handler to the platform service.
525
+ */
526
+ requestId?: string | undefined);
513
527
  }
514
528
  declare function errorCodeToStatus(code: string): number;
515
529
  /**
@@ -521,6 +535,12 @@ type SdkResult<T> = {
521
535
  data?: T | null;
522
536
  error?: ApiError | null;
523
537
  success?: boolean;
538
+ /** Platform envelope metadata; `request_id` is echoed onto ScaleMuleError. */
539
+ meta?: {
540
+ request_id?: string;
541
+ trace_id?: string;
542
+ timestamp?: string;
543
+ };
524
544
  };
525
545
  /**
526
546
  * Convert an SDK result into throw-on-error, or pass through a raw value.
@@ -1,6 +1,6 @@
1
- import { S as ServerConfig } from '../webhook-handler-Cfa7-yKN.js';
2
- export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-Cfa7-yKN.js';
3
- import { p as ClientContext, A as ApiError } from '../index-Tq5WdDfS.js';
1
+ import { S as ServerConfig } from '../webhook-handler-5ymVecTD.js';
2
+ export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-5ymVecTD.js';
3
+ import { p as ClientContext, A as ApiError } from '../index-Bv1m_qQ8.js';
4
4
  export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.js';
5
5
  import { NextRequest, NextResponse } from 'next/server';
6
6
  import '@scalemule/money';
@@ -509,7 +509,21 @@ declare class ScaleMuleError extends Error {
509
509
  readonly code: string;
510
510
  readonly status: number;
511
511
  readonly details?: Record<string, unknown> | undefined;
512
- constructor(code: string, message: string, status?: number, details?: Record<string, unknown> | undefined);
512
+ /**
513
+ * Correlation id of the upstream platform request that produced this
514
+ * error, when there was one. `apiHandler()` echoes it back to the browser
515
+ * as `meta.request_id` so a client-side failure can be traced all the way
516
+ * through the route handler to the platform service.
517
+ */
518
+ readonly requestId?: string | undefined;
519
+ constructor(code: string, message: string, status?: number, details?: Record<string, unknown> | undefined,
520
+ /**
521
+ * Correlation id of the upstream platform request that produced this
522
+ * error, when there was one. `apiHandler()` echoes it back to the browser
523
+ * as `meta.request_id` so a client-side failure can be traced all the way
524
+ * through the route handler to the platform service.
525
+ */
526
+ requestId?: string | undefined);
513
527
  }
514
528
  declare function errorCodeToStatus(code: string): number;
515
529
  /**
@@ -521,6 +535,12 @@ type SdkResult<T> = {
521
535
  data?: T | null;
522
536
  error?: ApiError | null;
523
537
  success?: boolean;
538
+ /** Platform envelope metadata; `request_id` is echoed onto ScaleMuleError. */
539
+ meta?: {
540
+ request_id?: string;
541
+ trace_id?: string;
542
+ timestamp?: string;
543
+ };
524
544
  };
525
545
  /**
526
546
  * Convert an SDK result into throw-on-error, or pass through a raw value.
@@ -17,6 +17,9 @@ var ScaleMuleApiError = class extends Error {
17
17
  this.code = error.code;
18
18
  this.field = error.field;
19
19
  this.status = status;
20
+ this.requestId = error.requestId;
21
+ this.traceId = error.traceId;
22
+ this.problem = error.problem;
20
23
  }
21
24
  };
22
25
 
@@ -179,6 +182,25 @@ function buildFlagContext(clientContext, extraContext = {}) {
179
182
  return context;
180
183
  }
181
184
 
185
+ // src/error-context.ts
186
+ function withErrorContext(error, responseData, headers3) {
187
+ const enriched = { ...error };
188
+ const meta = responseData?.meta;
189
+ const requestId = meta?.request_id ?? headers3?.get("x-request-id") ?? void 0;
190
+ if (requestId !== void 0 && enriched.requestId === void 0) {
191
+ enriched.requestId = requestId;
192
+ }
193
+ const traceId = meta?.trace_id;
194
+ if (traceId !== void 0 && enriched.traceId === void 0) {
195
+ enriched.traceId = traceId;
196
+ }
197
+ const rawError = responseData?.error;
198
+ if (rawError !== null && typeof rawError === "object" && enriched.problem === void 0) {
199
+ enriched.problem = rawError;
200
+ }
201
+ return enriched;
202
+ }
203
+
182
204
  // src/server/client.ts
183
205
  var GATEWAY_URLS = {
184
206
  dev: "https://api-dev.scalemule.com",
@@ -598,7 +620,11 @@ var ScaleMuleServer = class {
598
620
  }
599
621
  if (!response.ok) {
600
622
  throw new ScaleMuleApiError(
601
- responseData?.error || { code: "UPLOAD_FAILED", message: text || "Upload failed" }
623
+ withErrorContext(
624
+ responseData?.error || { code: "UPLOAD_FAILED", message: text || "Upload failed" },
625
+ responseData,
626
+ response.headers
627
+ )
602
628
  );
603
629
  }
604
630
  const data = responseData?.data !== void 0 ? responseData.data : responseData;
@@ -841,10 +867,11 @@ var ScaleMuleServer = class {
841
867
  } catch {
842
868
  }
843
869
  if (!response.ok) {
844
- const error = responseData?.error || {
870
+ const baseError = responseData?.error || {
845
871
  code: `HTTP_${response.status}`,
846
872
  message: responseData?.message || text || response.statusText
847
873
  };
874
+ const error = withErrorContext(baseError, responseData, response.headers);
848
875
  if (response.status === 401 && options.sessionToken && !options.isAutoRefresh) {
849
876
  if (this.debug) console.log("[ScaleMule Server] 401 received, attempting auto-refresh...");
850
877
  try {
@@ -2537,11 +2564,12 @@ function createNotificationRoutes(config) {
2537
2564
 
2538
2565
  // src/server/errors.ts
2539
2566
  var ScaleMuleError = class extends Error {
2540
- constructor(code, message, status = 400, details) {
2567
+ constructor(code, message, status = 400, details, requestId) {
2541
2568
  super(message);
2542
2569
  this.code = code;
2543
2570
  this.status = status;
2544
2571
  this.details = details;
2572
+ this.requestId = requestId;
2545
2573
  this.name = "ScaleMuleError";
2546
2574
  }
2547
2575
  };
@@ -2595,7 +2623,8 @@ function unwrap(result) {
2595
2623
  code,
2596
2624
  err?.message || "An error occurred",
2597
2625
  status,
2598
- err?.details
2626
+ err?.details,
2627
+ err?.requestId ?? envelope.meta?.request_id
2599
2628
  );
2600
2629
  }
2601
2630
  return envelope.data;
@@ -2644,7 +2673,11 @@ function apiHandler(handler, options) {
2644
2673
  console.error("Internal API error:", error.message);
2645
2674
  }
2646
2675
  return Response.json(
2647
- { success: false, error: { code: error.code, message: safeMessage } },
2676
+ {
2677
+ success: false,
2678
+ error: { code: error.code, message: safeMessage },
2679
+ ...error.requestId ? { meta: { request_id: error.requestId } } : {}
2680
+ },
2648
2681
  { status: error.status }
2649
2682
  );
2650
2683
  }
@@ -15,6 +15,9 @@ var ScaleMuleApiError = class extends Error {
15
15
  this.code = error.code;
16
16
  this.field = error.field;
17
17
  this.status = status;
18
+ this.requestId = error.requestId;
19
+ this.traceId = error.traceId;
20
+ this.problem = error.problem;
18
21
  }
19
22
  };
20
23
 
@@ -177,6 +180,25 @@ function buildFlagContext(clientContext, extraContext = {}) {
177
180
  return context;
178
181
  }
179
182
 
183
+ // src/error-context.ts
184
+ function withErrorContext(error, responseData, headers3) {
185
+ const enriched = { ...error };
186
+ const meta = responseData?.meta;
187
+ const requestId = meta?.request_id ?? headers3?.get("x-request-id") ?? void 0;
188
+ if (requestId !== void 0 && enriched.requestId === void 0) {
189
+ enriched.requestId = requestId;
190
+ }
191
+ const traceId = meta?.trace_id;
192
+ if (traceId !== void 0 && enriched.traceId === void 0) {
193
+ enriched.traceId = traceId;
194
+ }
195
+ const rawError = responseData?.error;
196
+ if (rawError !== null && typeof rawError === "object" && enriched.problem === void 0) {
197
+ enriched.problem = rawError;
198
+ }
199
+ return enriched;
200
+ }
201
+
180
202
  // src/server/client.ts
181
203
  var GATEWAY_URLS = {
182
204
  dev: "https://api-dev.scalemule.com",
@@ -596,7 +618,11 @@ var ScaleMuleServer = class {
596
618
  }
597
619
  if (!response.ok) {
598
620
  throw new ScaleMuleApiError(
599
- responseData?.error || { code: "UPLOAD_FAILED", message: text || "Upload failed" }
621
+ withErrorContext(
622
+ responseData?.error || { code: "UPLOAD_FAILED", message: text || "Upload failed" },
623
+ responseData,
624
+ response.headers
625
+ )
600
626
  );
601
627
  }
602
628
  const data = responseData?.data !== void 0 ? responseData.data : responseData;
@@ -839,10 +865,11 @@ var ScaleMuleServer = class {
839
865
  } catch {
840
866
  }
841
867
  if (!response.ok) {
842
- const error = responseData?.error || {
868
+ const baseError = responseData?.error || {
843
869
  code: `HTTP_${response.status}`,
844
870
  message: responseData?.message || text || response.statusText
845
871
  };
872
+ const error = withErrorContext(baseError, responseData, response.headers);
846
873
  if (response.status === 401 && options.sessionToken && !options.isAutoRefresh) {
847
874
  if (this.debug) console.log("[ScaleMule Server] 401 received, attempting auto-refresh...");
848
875
  try {
@@ -2535,11 +2562,12 @@ function createNotificationRoutes(config) {
2535
2562
 
2536
2563
  // src/server/errors.ts
2537
2564
  var ScaleMuleError = class extends Error {
2538
- constructor(code, message, status = 400, details) {
2565
+ constructor(code, message, status = 400, details, requestId) {
2539
2566
  super(message);
2540
2567
  this.code = code;
2541
2568
  this.status = status;
2542
2569
  this.details = details;
2570
+ this.requestId = requestId;
2543
2571
  this.name = "ScaleMuleError";
2544
2572
  }
2545
2573
  };
@@ -2593,7 +2621,8 @@ function unwrap(result) {
2593
2621
  code,
2594
2622
  err?.message || "An error occurred",
2595
2623
  status,
2596
- err?.details
2624
+ err?.details,
2625
+ err?.requestId ?? envelope.meta?.request_id
2597
2626
  );
2598
2627
  }
2599
2628
  return envelope.data;
@@ -2642,7 +2671,11 @@ function apiHandler(handler, options) {
2642
2671
  console.error("Internal API error:", error.message);
2643
2672
  }
2644
2673
  return Response.json(
2645
- { success: false, error: { code: error.code, message: safeMessage } },
2674
+ {
2675
+ success: false,
2676
+ error: { code: error.code, message: safeMessage },
2677
+ ...error.requestId ? { meta: { request_id: error.requestId } } : {}
2678
+ },
2646
2679
  { status: error.status }
2647
2680
  );
2648
2681
  }
@@ -1,3 +1,3 @@
1
- export { g as createWebhookHandler } from '../webhook-handler-DN4WBjbm.mjs';
1
+ export { g as createWebhookHandler } from '../webhook-handler-CVmBvPFN.mjs';
2
2
  import '@scalemule/money';
3
- import '../index-Tq5WdDfS.mjs';
3
+ import '../index-Bv1m_qQ8.mjs';
@@ -1,3 +1,3 @@
1
- export { g as createWebhookHandler } from '../webhook-handler-Cfa7-yKN.js';
1
+ export { g as createWebhookHandler } from '../webhook-handler-5ymVecTD.js';
2
2
  import '@scalemule/money';
3
- import '../index-Tq5WdDfS.js';
3
+ import '../index-Bv1m_qQ8.js';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { U as User, A as ApiError, a9 as StorageFile } from './index-Tq5WdDfS.mjs';
3
+ import { U as User, A as ApiError, a9 as StorageFile } from './index-Bv1m_qQ8.mjs';
4
4
 
5
5
  interface MockUserOptions {
6
6
  id?: string;
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { U as User, A as ApiError, a9 as StorageFile } from './index-Tq5WdDfS.js';
3
+ import { U as User, A as ApiError, a9 as StorageFile } from './index-Bv1m_qQ8.js';
4
4
 
5
5
  interface MockUserOptions {
6
6
  id?: string;
package/dist/testing.js CHANGED
@@ -11,6 +11,9 @@ var ScaleMuleApiError = class extends Error {
11
11
  this.code = error.code;
12
12
  this.field = error.field;
13
13
  this.status = status;
14
+ this.requestId = error.requestId;
15
+ this.traceId = error.traceId;
16
+ this.problem = error.problem;
14
17
  }
15
18
  };
16
19
  function createMockUser(options = {}) {
package/dist/testing.mjs CHANGED
@@ -9,6 +9,9 @@ var ScaleMuleApiError = class extends Error {
9
9
  this.code = error.code;
10
10
  this.field = error.field;
11
11
  this.status = status;
12
+ this.requestId = error.requestId;
13
+ this.traceId = error.traceId;
14
+ this.problem = error.problem;
12
15
  }
13
16
  };
14
17
  function createMockUser(options = {}) {
@@ -1,5 +1,5 @@
1
1
  import { MoneyClient } from '@scalemule/money';
2
- import { A as ApiError, $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-Tq5WdDfS.js';
2
+ import { A as ApiError, $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-Bv1m_qQ8.js';
3
3
 
4
4
  /**
5
5
  * Server-Side ScaleMule Client
@@ -1,5 +1,5 @@
1
1
  import { MoneyClient } from '@scalemule/money';
2
- import { A as ApiError, $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-Tq5WdDfS.mjs';
2
+ import { A as ApiError, $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-Bv1m_qQ8.mjs';
3
3
 
4
4
  /**
5
5
  * Server-Side ScaleMule Client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/nextjs",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "ScaleMule SDK for Next.js applications - authentication, storage, and user management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -55,12 +55,13 @@
55
55
  "type-check": "tsc --noEmit",
56
56
  "lint": "tsc --noEmit",
57
57
  "clean": "rm -rf dist",
58
- "prepublishOnly": "node -e \"const v=require('./package.json').version; if(!/^0\\.(0|1)\\.\\d+$/.test(v)){console.error('ERR: SDK '+v+' violates patch-only policy (0.0.x or 0.1.x only). See CONTRIBUTING.md SDK versioning section.');process.exit(1)}\""
58
+ "prepublishOnly": "node -e \"const v=require('./package.json').version; if(!/^0\\.(0|1)\\.\\d+$/.test(v)){console.error('ERR: SDK '+v+' violates patch-only policy (0.0.x or 0.1.x only). See CONTRIBUTING.md SDK versioning section.');process.exit(1)}\"",
59
+ "release": "npm run build && npm test && npm run type-check && npm publish --access public"
59
60
  },
60
61
  "dependencies": {
61
62
  "@scalemule/ledvery": "^0.0.1",
62
63
  "@scalemule/money": "^0.0.1",
63
- "@scalemule/sdk": "^0.0.63"
64
+ "@scalemule/sdk": "^0.0.64"
64
65
  },
65
66
  "peerDependencies": {
66
67
  "next": ">=14.0.0",