@stackbe/sdk 0.12.0 → 0.12.1

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
@@ -1534,15 +1534,25 @@ declare class OrganizationsClient {
1534
1534
  */
1535
1535
  update(orgId: string, options: UpdateOrganizationOptions): Promise<Organization>;
1536
1536
  /**
1537
- * Delete an organization.
1538
- * Note: Organizations with active subscriptions cannot be deleted.
1537
+ * Delete an organization (soft-delete).
1538
+ * By default, fails if org has active subscriptions.
1539
+ * Pass cancelSubscriptions: true to auto-cancel them first.
1539
1540
  *
1540
1541
  * @example
1541
1542
  * ```typescript
1543
+ * // Basic delete (fails if active subscriptions)
1542
1544
  * await stackbe.organizations.delete('org_123');
1545
+ *
1546
+ * // Force delete with subscription cancellation
1547
+ * await stackbe.organizations.delete('org_123', { cancelSubscriptions: true });
1543
1548
  * ```
1544
1549
  */
1545
- delete(orgId: string): Promise<void>;
1550
+ delete(orgId: string, options?: {
1551
+ cancelSubscriptions?: boolean;
1552
+ }): Promise<{
1553
+ success: boolean;
1554
+ cancelledSubscriptions: number;
1555
+ }>;
1546
1556
  /**
1547
1557
  * Add a customer as a member of an organization.
1548
1558
  *
package/dist/index.d.ts CHANGED
@@ -1534,15 +1534,25 @@ declare class OrganizationsClient {
1534
1534
  */
1535
1535
  update(orgId: string, options: UpdateOrganizationOptions): Promise<Organization>;
1536
1536
  /**
1537
- * Delete an organization.
1538
- * Note: Organizations with active subscriptions cannot be deleted.
1537
+ * Delete an organization (soft-delete).
1538
+ * By default, fails if org has active subscriptions.
1539
+ * Pass cancelSubscriptions: true to auto-cancel them first.
1539
1540
  *
1540
1541
  * @example
1541
1542
  * ```typescript
1543
+ * // Basic delete (fails if active subscriptions)
1542
1544
  * await stackbe.organizations.delete('org_123');
1545
+ *
1546
+ * // Force delete with subscription cancellation
1547
+ * await stackbe.organizations.delete('org_123', { cancelSubscriptions: true });
1543
1548
  * ```
1544
1549
  */
1545
- delete(orgId: string): Promise<void>;
1550
+ delete(orgId: string, options?: {
1551
+ cancelSubscriptions?: boolean;
1552
+ }): Promise<{
1553
+ success: boolean;
1554
+ cancelledSubscriptions: number;
1555
+ }>;
1546
1556
  /**
1547
1557
  * Add a customer as a member of an organization.
1548
1558
  *
package/dist/index.js CHANGED
@@ -1549,17 +1549,23 @@ var OrganizationsClient = class {
1549
1549
  );
1550
1550
  }
1551
1551
  /**
1552
- * Delete an organization.
1553
- * Note: Organizations with active subscriptions cannot be deleted.
1552
+ * Delete an organization (soft-delete).
1553
+ * By default, fails if org has active subscriptions.
1554
+ * Pass cancelSubscriptions: true to auto-cancel them first.
1554
1555
  *
1555
1556
  * @example
1556
1557
  * ```typescript
1558
+ * // Basic delete (fails if active subscriptions)
1557
1559
  * await stackbe.organizations.delete('org_123');
1560
+ *
1561
+ * // Force delete with subscription cancellation
1562
+ * await stackbe.organizations.delete('org_123', { cancelSubscriptions: true });
1558
1563
  * ```
1559
1564
  */
1560
- async delete(orgId) {
1565
+ async delete(orgId, options) {
1566
+ const query = options?.cancelSubscriptions ? "?cancelSubscriptions=true" : "";
1561
1567
  return this.http.delete(
1562
- `/v1/apps/${this.appId}/admin/organizations/${orgId}`
1568
+ `/v1/apps/${this.appId}/admin/organizations/${orgId}${query}`
1563
1569
  );
1564
1570
  }
1565
1571
  /**
package/dist/index.mjs CHANGED
@@ -1508,17 +1508,23 @@ var OrganizationsClient = class {
1508
1508
  );
1509
1509
  }
1510
1510
  /**
1511
- * Delete an organization.
1512
- * Note: Organizations with active subscriptions cannot be deleted.
1511
+ * Delete an organization (soft-delete).
1512
+ * By default, fails if org has active subscriptions.
1513
+ * Pass cancelSubscriptions: true to auto-cancel them first.
1513
1514
  *
1514
1515
  * @example
1515
1516
  * ```typescript
1517
+ * // Basic delete (fails if active subscriptions)
1516
1518
  * await stackbe.organizations.delete('org_123');
1519
+ *
1520
+ * // Force delete with subscription cancellation
1521
+ * await stackbe.organizations.delete('org_123', { cancelSubscriptions: true });
1517
1522
  * ```
1518
1523
  */
1519
- async delete(orgId) {
1524
+ async delete(orgId, options) {
1525
+ const query = options?.cancelSubscriptions ? "?cancelSubscriptions=true" : "";
1520
1526
  return this.http.delete(
1521
- `/v1/apps/${this.appId}/admin/organizations/${orgId}`
1527
+ `/v1/apps/${this.appId}/admin/organizations/${orgId}${query}`
1522
1528
  );
1523
1529
  }
1524
1530
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackbe/sdk",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Official JavaScript/TypeScript SDK for StackBE - the billing backend for your side project",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",