@stackbe/sdk 0.8.0 → 0.8.2

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
@@ -1256,7 +1256,8 @@ declare class OrganizationsClient {
1256
1256
  role: 'admin' | 'member';
1257
1257
  }): Promise<OrganizationMember>;
1258
1258
  /**
1259
- * Send an invite to join an organization.
1259
+ * Send an invite email to join an organization.
1260
+ * The recipient will receive a magic link.
1260
1261
  *
1261
1262
  * @example
1262
1263
  * ```typescript
@@ -1267,6 +1268,21 @@ declare class OrganizationsClient {
1267
1268
  * ```
1268
1269
  */
1269
1270
  invite(orgId: string, options: InviteMemberOptions): Promise<OrganizationInvite>;
1271
+ /**
1272
+ * List all members and pending invites for an organization.
1273
+ *
1274
+ * @example
1275
+ * ```typescript
1276
+ * const { members, invites } = await stackbe.organizations.listMembers('org_123');
1277
+ *
1278
+ * members.forEach(m => console.log(`${m.customer.email} - ${m.role}`));
1279
+ * invites.forEach(i => console.log(`Pending: ${i.email}`));
1280
+ * ```
1281
+ */
1282
+ listMembers(orgId: string): Promise<{
1283
+ members: OrganizationMember[];
1284
+ invites: OrganizationInvite[];
1285
+ }>;
1270
1286
  /**
1271
1287
  * List pending invites for an organization.
1272
1288
  *
@@ -1400,7 +1416,14 @@ declare class ProductsClient {
1400
1416
  interface FeatureRequest {
1401
1417
  id: string;
1402
1418
  title: string;
1419
+ /** @deprecated Use featureDetails instead */
1403
1420
  description?: string;
1421
+ /** What currently happens (the current behavior you want to change) */
1422
+ currentBehavior?: string;
1423
+ /** Detailed description of the requested feature */
1424
+ featureDetails?: string;
1425
+ /** Why this feature is important */
1426
+ whyItMatters?: string;
1404
1427
  status: 'new' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
1405
1428
  category?: string;
1406
1429
  authorId: string;
@@ -1419,10 +1442,17 @@ interface FeatureRequestComment {
1419
1442
  }
1420
1443
  interface CreateFeatureRequestOptions {
1421
1444
  title: string;
1422
- description?: string;
1445
+ /** What currently happens (the current behavior you want to change) */
1446
+ currentBehavior?: string;
1447
+ /** Detailed description of the requested feature */
1448
+ featureDetails?: string;
1449
+ /** Why this feature is important */
1450
+ whyItMatters?: string;
1423
1451
  category?: string;
1424
1452
  /** Customer ID for server-side creation with API key */
1425
1453
  customerId?: string;
1454
+ /** @deprecated Use featureDetails instead */
1455
+ description?: string;
1426
1456
  }
1427
1457
  interface ListFeatureRequestsOptions {
1428
1458
  status?: 'new' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
@@ -1507,14 +1537,16 @@ declare class FeatureRequestsClient {
1507
1537
  * // With customer session token
1508
1538
  * const request = await stackbe.featureRequests.create({
1509
1539
  * title: 'Dark mode support',
1510
- * description: 'Would love to have a dark theme option',
1540
+ * currentBehavior: 'The app only has a light theme',
1541
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1542
+ * whyItMatters: 'Reduces eye strain when working at night',
1511
1543
  * category: 'UI',
1512
1544
  * });
1513
1545
  *
1514
1546
  * // With API key (server-side)
1515
1547
  * const request = await stackbe.featureRequests.create({
1516
1548
  * title: 'Dark mode support',
1517
- * description: 'Would love to have a dark theme option',
1549
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1518
1550
  * customerId: 'cust_123',
1519
1551
  * });
1520
1552
  * ```
package/dist/index.d.ts CHANGED
@@ -1256,7 +1256,8 @@ declare class OrganizationsClient {
1256
1256
  role: 'admin' | 'member';
1257
1257
  }): Promise<OrganizationMember>;
1258
1258
  /**
1259
- * Send an invite to join an organization.
1259
+ * Send an invite email to join an organization.
1260
+ * The recipient will receive a magic link.
1260
1261
  *
1261
1262
  * @example
1262
1263
  * ```typescript
@@ -1267,6 +1268,21 @@ declare class OrganizationsClient {
1267
1268
  * ```
1268
1269
  */
1269
1270
  invite(orgId: string, options: InviteMemberOptions): Promise<OrganizationInvite>;
1271
+ /**
1272
+ * List all members and pending invites for an organization.
1273
+ *
1274
+ * @example
1275
+ * ```typescript
1276
+ * const { members, invites } = await stackbe.organizations.listMembers('org_123');
1277
+ *
1278
+ * members.forEach(m => console.log(`${m.customer.email} - ${m.role}`));
1279
+ * invites.forEach(i => console.log(`Pending: ${i.email}`));
1280
+ * ```
1281
+ */
1282
+ listMembers(orgId: string): Promise<{
1283
+ members: OrganizationMember[];
1284
+ invites: OrganizationInvite[];
1285
+ }>;
1270
1286
  /**
1271
1287
  * List pending invites for an organization.
1272
1288
  *
@@ -1400,7 +1416,14 @@ declare class ProductsClient {
1400
1416
  interface FeatureRequest {
1401
1417
  id: string;
1402
1418
  title: string;
1419
+ /** @deprecated Use featureDetails instead */
1403
1420
  description?: string;
1421
+ /** What currently happens (the current behavior you want to change) */
1422
+ currentBehavior?: string;
1423
+ /** Detailed description of the requested feature */
1424
+ featureDetails?: string;
1425
+ /** Why this feature is important */
1426
+ whyItMatters?: string;
1404
1427
  status: 'new' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
1405
1428
  category?: string;
1406
1429
  authorId: string;
@@ -1419,10 +1442,17 @@ interface FeatureRequestComment {
1419
1442
  }
1420
1443
  interface CreateFeatureRequestOptions {
1421
1444
  title: string;
1422
- description?: string;
1445
+ /** What currently happens (the current behavior you want to change) */
1446
+ currentBehavior?: string;
1447
+ /** Detailed description of the requested feature */
1448
+ featureDetails?: string;
1449
+ /** Why this feature is important */
1450
+ whyItMatters?: string;
1423
1451
  category?: string;
1424
1452
  /** Customer ID for server-side creation with API key */
1425
1453
  customerId?: string;
1454
+ /** @deprecated Use featureDetails instead */
1455
+ description?: string;
1426
1456
  }
1427
1457
  interface ListFeatureRequestsOptions {
1428
1458
  status?: 'new' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
@@ -1507,14 +1537,16 @@ declare class FeatureRequestsClient {
1507
1537
  * // With customer session token
1508
1538
  * const request = await stackbe.featureRequests.create({
1509
1539
  * title: 'Dark mode support',
1510
- * description: 'Would love to have a dark theme option',
1540
+ * currentBehavior: 'The app only has a light theme',
1541
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1542
+ * whyItMatters: 'Reduces eye strain when working at night',
1511
1543
  * category: 'UI',
1512
1544
  * });
1513
1545
  *
1514
1546
  * // With API key (server-side)
1515
1547
  * const request = await stackbe.featureRequests.create({
1516
1548
  * title: 'Dark mode support',
1517
- * description: 'Would love to have a dark theme option',
1549
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1518
1550
  * customerId: 'cust_123',
1519
1551
  * });
1520
1552
  * ```
package/dist/index.js CHANGED
@@ -1333,7 +1333,8 @@ var OrganizationsClient = class {
1333
1333
  );
1334
1334
  }
1335
1335
  /**
1336
- * Send an invite to join an organization.
1336
+ * Send an invite email to join an organization.
1337
+ * The recipient will receive a magic link.
1337
1338
  *
1338
1339
  * @example
1339
1340
  * ```typescript
@@ -1345,10 +1346,26 @@ var OrganizationsClient = class {
1345
1346
  */
1346
1347
  async invite(orgId, options) {
1347
1348
  return this.http.post(
1348
- `/v1/apps/${this.appId}/admin/organizations/${orgId}/invites`,
1349
+ `/v1/apps/${this.appId}/admin/organizations/${orgId}/members/invite`,
1349
1350
  options
1350
1351
  );
1351
1352
  }
1353
+ /**
1354
+ * List all members and pending invites for an organization.
1355
+ *
1356
+ * @example
1357
+ * ```typescript
1358
+ * const { members, invites } = await stackbe.organizations.listMembers('org_123');
1359
+ *
1360
+ * members.forEach(m => console.log(`${m.customer.email} - ${m.role}`));
1361
+ * invites.forEach(i => console.log(`Pending: ${i.email}`));
1362
+ * ```
1363
+ */
1364
+ async listMembers(orgId) {
1365
+ return this.http.get(
1366
+ `/v1/apps/${this.appId}/admin/organizations/${orgId}/members`
1367
+ );
1368
+ }
1352
1369
  /**
1353
1370
  * List pending invites for an organization.
1354
1371
  *
@@ -1358,9 +1375,8 @@ var OrganizationsClient = class {
1358
1375
  * ```
1359
1376
  */
1360
1377
  async listInvites(orgId) {
1361
- return this.http.get(
1362
- `/v1/apps/${this.appId}/admin/organizations/${orgId}/invites`
1363
- );
1378
+ const { invites } = await this.listMembers(orgId);
1379
+ return invites;
1364
1380
  }
1365
1381
  /**
1366
1382
  * Cancel a pending invite.
@@ -1372,7 +1388,7 @@ var OrganizationsClient = class {
1372
1388
  */
1373
1389
  async cancelInvite(orgId, inviteId) {
1374
1390
  return this.http.delete(
1375
- `/v1/apps/${this.appId}/admin/organizations/${orgId}/invites/${inviteId}`
1391
+ `/v1/apps/${this.appId}/admin/organizations/${orgId}/members/${inviteId}`
1376
1392
  );
1377
1393
  }
1378
1394
  };
@@ -1525,14 +1541,16 @@ var FeatureRequestsClient = class {
1525
1541
  * // With customer session token
1526
1542
  * const request = await stackbe.featureRequests.create({
1527
1543
  * title: 'Dark mode support',
1528
- * description: 'Would love to have a dark theme option',
1544
+ * currentBehavior: 'The app only has a light theme',
1545
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1546
+ * whyItMatters: 'Reduces eye strain when working at night',
1529
1547
  * category: 'UI',
1530
1548
  * });
1531
1549
  *
1532
1550
  * // With API key (server-side)
1533
1551
  * const request = await stackbe.featureRequests.create({
1534
1552
  * title: 'Dark mode support',
1535
- * description: 'Would love to have a dark theme option',
1553
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1536
1554
  * customerId: 'cust_123',
1537
1555
  * });
1538
1556
  * ```
package/dist/index.mjs CHANGED
@@ -1294,7 +1294,8 @@ var OrganizationsClient = class {
1294
1294
  );
1295
1295
  }
1296
1296
  /**
1297
- * Send an invite to join an organization.
1297
+ * Send an invite email to join an organization.
1298
+ * The recipient will receive a magic link.
1298
1299
  *
1299
1300
  * @example
1300
1301
  * ```typescript
@@ -1306,10 +1307,26 @@ var OrganizationsClient = class {
1306
1307
  */
1307
1308
  async invite(orgId, options) {
1308
1309
  return this.http.post(
1309
- `/v1/apps/${this.appId}/admin/organizations/${orgId}/invites`,
1310
+ `/v1/apps/${this.appId}/admin/organizations/${orgId}/members/invite`,
1310
1311
  options
1311
1312
  );
1312
1313
  }
1314
+ /**
1315
+ * List all members and pending invites for an organization.
1316
+ *
1317
+ * @example
1318
+ * ```typescript
1319
+ * const { members, invites } = await stackbe.organizations.listMembers('org_123');
1320
+ *
1321
+ * members.forEach(m => console.log(`${m.customer.email} - ${m.role}`));
1322
+ * invites.forEach(i => console.log(`Pending: ${i.email}`));
1323
+ * ```
1324
+ */
1325
+ async listMembers(orgId) {
1326
+ return this.http.get(
1327
+ `/v1/apps/${this.appId}/admin/organizations/${orgId}/members`
1328
+ );
1329
+ }
1313
1330
  /**
1314
1331
  * List pending invites for an organization.
1315
1332
  *
@@ -1319,9 +1336,8 @@ var OrganizationsClient = class {
1319
1336
  * ```
1320
1337
  */
1321
1338
  async listInvites(orgId) {
1322
- return this.http.get(
1323
- `/v1/apps/${this.appId}/admin/organizations/${orgId}/invites`
1324
- );
1339
+ const { invites } = await this.listMembers(orgId);
1340
+ return invites;
1325
1341
  }
1326
1342
  /**
1327
1343
  * Cancel a pending invite.
@@ -1333,7 +1349,7 @@ var OrganizationsClient = class {
1333
1349
  */
1334
1350
  async cancelInvite(orgId, inviteId) {
1335
1351
  return this.http.delete(
1336
- `/v1/apps/${this.appId}/admin/organizations/${orgId}/invites/${inviteId}`
1352
+ `/v1/apps/${this.appId}/admin/organizations/${orgId}/members/${inviteId}`
1337
1353
  );
1338
1354
  }
1339
1355
  };
@@ -1486,14 +1502,16 @@ var FeatureRequestsClient = class {
1486
1502
  * // With customer session token
1487
1503
  * const request = await stackbe.featureRequests.create({
1488
1504
  * title: 'Dark mode support',
1489
- * description: 'Would love to have a dark theme option',
1505
+ * currentBehavior: 'The app only has a light theme',
1506
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1507
+ * whyItMatters: 'Reduces eye strain when working at night',
1490
1508
  * category: 'UI',
1491
1509
  * });
1492
1510
  *
1493
1511
  * // With API key (server-side)
1494
1512
  * const request = await stackbe.featureRequests.create({
1495
1513
  * title: 'Dark mode support',
1496
- * description: 'Would love to have a dark theme option',
1514
+ * featureDetails: 'Add a toggle to switch between light and dark themes',
1497
1515
  * customerId: 'cust_123',
1498
1516
  * });
1499
1517
  * ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackbe/sdk",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
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",