@makolabs/ripple 1.7.5 → 1.7.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.
@@ -18,7 +18,12 @@ async function makeClerkRequest(endpoint, options = {}) {
18
18
  if (!CLERK_SECRET_KEY) {
19
19
  throw new Error('CLERK_SECRET_KEY environment variable is required');
20
20
  }
21
- const response = await fetch(`https://api.clerk.com/v1${endpoint}`, {
21
+ const method = options.method || 'GET';
22
+ const url = `https://api.clerk.com/v1${endpoint}`;
23
+ console.log(`[Clerk API] ${method} ${url}`);
24
+ if (options.body)
25
+ console.log(`[Clerk API] Payload: ${options.body}`);
26
+ const response = await fetch(url, {
22
27
  ...options,
23
28
  headers: {
24
29
  Authorization: `Bearer ${CLERK_SECRET_KEY}`,
@@ -28,7 +33,8 @@ async function makeClerkRequest(endpoint, options = {}) {
28
33
  });
29
34
  if (!response.ok) {
30
35
  const errorText = await response.text();
31
- console.error(`[Clerk API] ${response.status} ${response.statusText} - ${errorText}`);
36
+ console.error(`[Clerk API] Response: ${response.status} ${response.statusText}`);
37
+ console.error(`[Clerk API] Body: ${errorText}`);
32
38
  let errorDetails;
33
39
  try {
34
40
  errorDetails = JSON.parse(errorText);
@@ -42,6 +48,8 @@ async function makeClerkRequest(endpoint, options = {}) {
42
48
  throw error;
43
49
  }
44
50
  const data = await response.json();
51
+ console.log(`[Clerk API] Response: ${response.status} ${response.statusText}`);
52
+ console.log(`[Clerk API] Body: ${JSON.stringify(data).slice(0, 500)}`);
45
53
  // Ensure all data is serializable by converting to plain objects
46
54
  return JSON.parse(JSON.stringify(data));
47
55
  }
@@ -56,7 +64,11 @@ async function makeAdminRequest(endpoint, options = {}) {
56
64
  missing.push('PRIVATE_BASE_AUTH_URL');
57
65
  throw new Error(`Admin API configuration missing: ${missing.join(', ')}`);
58
66
  }
67
+ const method = options.method || 'GET';
59
68
  const url = `${PRIVATE_BASE_AUTH_URL}${endpoint}`;
69
+ console.log(`[Admin API] ${method} ${url}`);
70
+ if (options.body)
71
+ console.log(`[Admin API] Payload: ${options.body}`);
60
72
  const response = await fetch(url, {
61
73
  ...options,
62
74
  headers: {
@@ -67,10 +79,13 @@ async function makeAdminRequest(endpoint, options = {}) {
67
79
  });
68
80
  if (!response.ok) {
69
81
  const errorText = await response.text();
70
- console.error(`[Admin API] ${response.status} ${response.statusText} - ${errorText}`);
82
+ console.error(`[Admin API] Response: ${response.status} ${response.statusText}`);
83
+ console.error(`[Admin API] Body: ${errorText}`);
71
84
  throw new Error(`Admin API request failed: ${response.status} ${response.statusText} - ${errorText}`);
72
85
  }
73
86
  const data = await response.json();
87
+ console.log(`[Admin API] Response: ${response.status} ${response.statusText}`);
88
+ console.log(`[Admin API] Body: ${JSON.stringify(data).slice(0, 500)}`);
74
89
  // Ensure all data is serializable by converting to plain objects
75
90
  return JSON.parse(JSON.stringify(data));
76
91
  }
@@ -79,7 +94,11 @@ async function makeAuthRequest(endpoint, options = {}) {
79
94
  if (!PRIVATE_BASE_AUTH_URL) {
80
95
  throw new Error('PRIVATE_BASE_AUTH_URL environment variable is required');
81
96
  }
97
+ const method = options.method || 'GET';
82
98
  const url = `${PRIVATE_BASE_AUTH_URL}${endpoint}`;
99
+ console.log(`[Auth API] ${method} ${url}`);
100
+ if (options.body)
101
+ console.log(`[Auth API] Payload: ${options.body}`);
83
102
  const response = await fetch(url, {
84
103
  ...options,
85
104
  headers: {
@@ -96,6 +115,8 @@ async function makeAuthRequest(endpoint, options = {}) {
96
115
  // Not JSON, treat as plain text error (e.g., "404 page not found")
97
116
  data = { error: text, message: text };
98
117
  }
118
+ console.log(`[Auth API] Response: ${response.status} ${response.statusText}`);
119
+ console.log(`[Auth API] Body: ${JSON.stringify(data).slice(0, 500)}`);
99
120
  return {
100
121
  ok: response.ok,
101
122
  status: response.status,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makolabs/ripple",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "Simple Svelte 5 powered component library ✨",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {