@dream-api/sdk 0.1.3 → 0.1.4

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
@@ -57,7 +57,7 @@ interface Tier {
57
57
  limit: number;
58
58
  priceId: string;
59
59
  productId: string;
60
- features?: string;
60
+ features?: string[];
61
61
  popular?: boolean;
62
62
  }
63
63
  interface Product {
@@ -363,6 +363,8 @@ declare class DreamAPI {
363
363
  readonly products: ProductAPI;
364
364
  /** Dashboard metrics */
365
365
  readonly dashboard: DashboardAPI;
366
+ /** Account management (self-service) */
367
+ readonly account: AccountAPI;
366
368
  constructor(config: DreamAPIConfig);
367
369
  /**
368
370
  * Set the end-user JWT token.
@@ -549,5 +551,23 @@ declare class DashboardAPI {
549
551
  totalMRR: number;
550
552
  }>;
551
553
  }
554
+ declare class AccountAPI {
555
+ private client;
556
+ constructor(client: DreamClient);
557
+ /**
558
+ * Delete the current user's account.
559
+ * This permanently removes all user data.
560
+ *
561
+ * @example
562
+ * ```typescript
563
+ * await api.account.delete();
564
+ * // User is now signed out and deleted
565
+ * ```
566
+ */
567
+ delete(): Promise<{
568
+ success: boolean;
569
+ message: string;
570
+ }>;
571
+ }
552
572
 
553
573
  export { type CheckoutResult, type ClerkUser, type CreateCustomerParams, type Customer, type DashboardCustomer, type DashboardMetrics, DreamAPI, type DreamAPIConfig, type DreamAPIError, DreamAPIException, type Order, type PortalResult, type Product, type Tier, type Usage, type UsageTrackResult, type WebhookStatus, DreamAPI as default };
package/dist/index.d.ts CHANGED
@@ -57,7 +57,7 @@ interface Tier {
57
57
  limit: number;
58
58
  priceId: string;
59
59
  productId: string;
60
- features?: string;
60
+ features?: string[];
61
61
  popular?: boolean;
62
62
  }
63
63
  interface Product {
@@ -363,6 +363,8 @@ declare class DreamAPI {
363
363
  readonly products: ProductAPI;
364
364
  /** Dashboard metrics */
365
365
  readonly dashboard: DashboardAPI;
366
+ /** Account management (self-service) */
367
+ readonly account: AccountAPI;
366
368
  constructor(config: DreamAPIConfig);
367
369
  /**
368
370
  * Set the end-user JWT token.
@@ -549,5 +551,23 @@ declare class DashboardAPI {
549
551
  totalMRR: number;
550
552
  }>;
551
553
  }
554
+ declare class AccountAPI {
555
+ private client;
556
+ constructor(client: DreamClient);
557
+ /**
558
+ * Delete the current user's account.
559
+ * This permanently removes all user data.
560
+ *
561
+ * @example
562
+ * ```typescript
563
+ * await api.account.delete();
564
+ * // User is now signed out and deleted
565
+ * ```
566
+ */
567
+ delete(): Promise<{
568
+ success: boolean;
569
+ message: string;
570
+ }>;
571
+ }
552
572
 
553
573
  export { type CheckoutResult, type ClerkUser, type CreateCustomerParams, type Customer, type DashboardCustomer, type DashboardMetrics, DreamAPI, type DreamAPIConfig, type DreamAPIError, DreamAPIException, type Order, type PortalResult, type Product, type Tier, type Usage, type UsageTrackResult, type WebhookStatus, DreamAPI as default };
package/dist/index.js CHANGED
@@ -434,6 +434,7 @@ var DreamAPI = class {
434
434
  this.billing = new BillingAPI(this.client);
435
435
  this.products = new ProductAPI(this.client);
436
436
  this.dashboard = new DashboardAPI(this.client);
437
+ this.account = new AccountAPI(this.client);
437
438
  }
438
439
  /**
439
440
  * Set the end-user JWT token.
@@ -629,6 +630,24 @@ var DashboardAPI = class {
629
630
  return this.client.get("/api/dashboard/totals");
630
631
  }
631
632
  };
633
+ var AccountAPI = class {
634
+ constructor(client) {
635
+ this.client = client;
636
+ }
637
+ /**
638
+ * Delete the current user's account.
639
+ * This permanently removes all user data.
640
+ *
641
+ * @example
642
+ * ```typescript
643
+ * await api.account.delete();
644
+ * // User is now signed out and deleted
645
+ * ```
646
+ */
647
+ async delete() {
648
+ return this.client.delete("/api/me", true);
649
+ }
650
+ };
632
651
  var index_default = DreamAPI;
633
652
  // Annotate the CommonJS export names for ESM import in node:
634
653
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -406,6 +406,7 @@ var DreamAPI = class {
406
406
  this.billing = new BillingAPI(this.client);
407
407
  this.products = new ProductAPI(this.client);
408
408
  this.dashboard = new DashboardAPI(this.client);
409
+ this.account = new AccountAPI(this.client);
409
410
  }
410
411
  /**
411
412
  * Set the end-user JWT token.
@@ -601,6 +602,24 @@ var DashboardAPI = class {
601
602
  return this.client.get("/api/dashboard/totals");
602
603
  }
603
604
  };
605
+ var AccountAPI = class {
606
+ constructor(client) {
607
+ this.client = client;
608
+ }
609
+ /**
610
+ * Delete the current user's account.
611
+ * This permanently removes all user data.
612
+ *
613
+ * @example
614
+ * ```typescript
615
+ * await api.account.delete();
616
+ * // User is now signed out and deleted
617
+ * ```
618
+ */
619
+ async delete() {
620
+ return this.client.delete("/api/me", true);
621
+ }
622
+ };
604
623
  var index_default = DreamAPI;
605
624
  export {
606
625
  DreamAPI,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dream-api/sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Official SDK for Dream API - Auth, billing, and usage tracking in one API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",