@crosspost/sdk 0.1.14 → 0.2.0

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.cjs CHANGED
@@ -472,15 +472,6 @@ function openAuthPopup(url, options = {}) {
472
472
  } else {
473
473
  reject(message.data);
474
474
  }
475
- setTimeout(() => {
476
- try {
477
- if (popup && !popup.closed) {
478
- popup.close();
479
- }
480
- } catch (e) {
481
- console.warn("Failed to close popup window:", e);
482
- }
483
- }, 100);
484
475
  }
485
476
  };
486
477
  window.addEventListener("message", handleMessage);
package/dist/index.js CHANGED
@@ -426,15 +426,6 @@ function openAuthPopup(url, options = {}) {
426
426
  } else {
427
427
  reject(message.data);
428
428
  }
429
- setTimeout(() => {
430
- try {
431
- if (popup && !popup.closed) {
432
- popup.close();
433
- }
434
- } catch (e) {
435
- console.warn("Failed to close popup window:", e);
436
- }
437
- }, 100);
438
429
  }
439
430
  };
440
431
  window.addEventListener("message", handleMessage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crosspost/sdk",
3
- "version": "0.1.14",
3
+ "version": "0.2.0",
4
4
  "description": "SDK for interacting with the Crosspost API",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -1,5 +1,5 @@
1
1
  // @ts-nocheck
2
- import type { AuthStatus, PlatformName } from '@crosspost/types';
2
+ import type { PlatformName } from '@crosspost/types';
3
3
  declare global {
4
4
  interface WindowEventMap {
5
5
  message: MessageEvent<AuthCallbackMessage>;
@@ -19,7 +19,11 @@ interface AuthCallbackData {
19
19
  userId?: string;
20
20
  error?: string;
21
21
  error_description?: string;
22
- status: AuthStatus;
22
+ status: {
23
+ message: string; // User-friendly status message
24
+ code: string; // Status code for programmatic handling
25
+ details?: string; // Additional details if needed
26
+ };
23
27
  }
24
28
 
25
29
  interface AuthCallbackMessage {
@@ -81,17 +85,6 @@ export function openAuthPopup(url: string, options: PopupOptions = {}): Promise<
81
85
  } else {
82
86
  reject(message.data);
83
87
  }
84
-
85
- // Give a moment for any final operations before closing
86
- setTimeout(() => {
87
- try {
88
- if (popup && !popup.closed) {
89
- popup.close();
90
- }
91
- } catch (e) {
92
- console.warn('Failed to close popup window:', e);
93
- }
94
- }, 100);
95
88
  }
96
89
  };
97
90