@zilfu/sdk 0.2.22 → 0.2.24

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
@@ -928,6 +928,9 @@ var ApiTokens = class extends HeyApiClient {
928
928
  }
929
929
  /**
930
930
  * Revoke an API token
931
+ *
932
+ * The API key itself cannot be revoked this way — rotate it instead, so
933
+ * the account is never left without one.
931
934
  */
932
935
  delete(options) {
933
936
  return (options.client ?? this.client).delete({
@@ -1145,6 +1148,108 @@ var Media = class extends HeyApiClient {
1145
1148
  });
1146
1149
  }
1147
1150
  };
1151
+ var Invitations = class extends HeyApiClient {
1152
+ /**
1153
+ * List pending invitations for an organization
1154
+ */
1155
+ list(options) {
1156
+ return (options.client ?? this.client).get({
1157
+ security: [{ scheme: "bearer", type: "http" }],
1158
+ url: "/organizations/{organization}/invitations",
1159
+ ...options
1160
+ });
1161
+ }
1162
+ /**
1163
+ * Send an invitation
1164
+ */
1165
+ create(options) {
1166
+ return (options.client ?? this.client).post({
1167
+ security: [{ scheme: "bearer", type: "http" }],
1168
+ url: "/organizations/{organization}/invitations",
1169
+ ...options,
1170
+ headers: {
1171
+ "Content-Type": "application/json",
1172
+ ...options.headers
1173
+ }
1174
+ });
1175
+ }
1176
+ /**
1177
+ * Revoke a pending invitation
1178
+ */
1179
+ delete(options) {
1180
+ return (options.client ?? this.client).delete({
1181
+ security: [{ scheme: "bearer", type: "http" }],
1182
+ url: "/organizations/{organization}/invitations/{invitation}",
1183
+ ...options
1184
+ });
1185
+ }
1186
+ /**
1187
+ * Regenerate token + expiry and resend the invitation email
1188
+ */
1189
+ resend(options) {
1190
+ return (options.client ?? this.client).post({
1191
+ security: [{ scheme: "bearer", type: "http" }],
1192
+ url: "/organizations/{organization}/invitations/{invitation}/resend",
1193
+ ...options
1194
+ });
1195
+ }
1196
+ };
1197
+ var Members = class extends HeyApiClient {
1198
+ /**
1199
+ * List members of an organization
1200
+ */
1201
+ list(options) {
1202
+ return (options.client ?? this.client).get({
1203
+ security: [{ scheme: "bearer", type: "http" }],
1204
+ url: "/organizations/{organization}/members",
1205
+ ...options
1206
+ });
1207
+ }
1208
+ /**
1209
+ * The authenticated user leaves the organization
1210
+ */
1211
+ leave(options) {
1212
+ return (options.client ?? this.client).post({
1213
+ security: [{ scheme: "bearer", type: "http" }],
1214
+ url: "/organizations/{organization}/members/leave",
1215
+ ...options
1216
+ });
1217
+ }
1218
+ /**
1219
+ * Remove a member, and with them their access to every space
1220
+ */
1221
+ delete(options) {
1222
+ return (options.client ?? this.client).delete({
1223
+ security: [{ scheme: "bearer", type: "http" }],
1224
+ url: "/organizations/{organization}/members/{user}",
1225
+ ...options
1226
+ });
1227
+ }
1228
+ /**
1229
+ * Update a member's permissions across the organization
1230
+ */
1231
+ update(options) {
1232
+ return (options.client ?? this.client).patch({
1233
+ security: [{ scheme: "bearer", type: "http" }],
1234
+ url: "/organizations/{organization}/members/{user}",
1235
+ ...options,
1236
+ headers: {
1237
+ "Content-Type": "application/json",
1238
+ ...options.headers
1239
+ }
1240
+ });
1241
+ }
1242
+ };
1243
+ var Organizations = class extends HeyApiClient {
1244
+ _invitations;
1245
+ get invitations() {
1246
+ return this._invitations ??= new Invitations({ client: this.client });
1247
+ }
1248
+ _members;
1249
+ get members() {
1250
+ return this._members ??= new Members({ client: this.client });
1251
+ }
1252
+ };
1148
1253
  var Comment = class extends HeyApiClient {
1149
1254
  /**
1150
1255
  * Attach a follow-up comment to an existing post. If the post has already
@@ -1399,98 +1504,6 @@ var Spaces = class extends HeyApiClient {
1399
1504
  });
1400
1505
  }
1401
1506
  };
1402
- var Invitations = class extends HeyApiClient {
1403
- /**
1404
- * List pending invitations for a space
1405
- */
1406
- list(options) {
1407
- return (options.client ?? this.client).get({
1408
- security: [{ scheme: "bearer", type: "http" }],
1409
- url: "/spaces/{space}/invitations",
1410
- ...options
1411
- });
1412
- }
1413
- /**
1414
- * Send an invitation
1415
- */
1416
- create(options) {
1417
- return (options.client ?? this.client).post({
1418
- security: [{ scheme: "bearer", type: "http" }],
1419
- url: "/spaces/{space}/invitations",
1420
- ...options,
1421
- headers: {
1422
- "Content-Type": "application/json",
1423
- ...options.headers
1424
- }
1425
- });
1426
- }
1427
- /**
1428
- * Revoke a pending invitation
1429
- */
1430
- delete(options) {
1431
- return (options.client ?? this.client).delete({
1432
- security: [{ scheme: "bearer", type: "http" }],
1433
- url: "/spaces/{space}/invitations/{invitation}",
1434
- ...options
1435
- });
1436
- }
1437
- /**
1438
- * Regenerate token + expiry and resend the invitation email
1439
- */
1440
- resend(options) {
1441
- return (options.client ?? this.client).post({
1442
- security: [{ scheme: "bearer", type: "http" }],
1443
- url: "/spaces/{space}/invitations/{invitation}/resend",
1444
- ...options
1445
- });
1446
- }
1447
- };
1448
- var Members = class extends HeyApiClient {
1449
- /**
1450
- * List members of a space
1451
- */
1452
- list(options) {
1453
- return (options.client ?? this.client).get({
1454
- security: [{ scheme: "bearer", type: "http" }],
1455
- url: "/spaces/{space}/members",
1456
- ...options
1457
- });
1458
- }
1459
- /**
1460
- * Remove a member from a space
1461
- */
1462
- delete(options) {
1463
- return (options.client ?? this.client).delete({
1464
- security: [{ scheme: "bearer", type: "http" }],
1465
- url: "/spaces/{space}/members/{user}",
1466
- ...options
1467
- });
1468
- }
1469
- /**
1470
- * Update a member's permissions
1471
- */
1472
- update(options) {
1473
- return (options.client ?? this.client).patch({
1474
- security: [{ scheme: "bearer", type: "http" }],
1475
- url: "/spaces/{space}/members/{user}",
1476
- ...options,
1477
- headers: {
1478
- "Content-Type": "application/json",
1479
- ...options.headers
1480
- }
1481
- });
1482
- }
1483
- /**
1484
- * The authenticated user leaves the space
1485
- */
1486
- leave(options) {
1487
- return (options.client ?? this.client).post({
1488
- security: [{ scheme: "bearer", type: "http" }],
1489
- url: "/spaces/{space}/members/leave",
1490
- ...options
1491
- });
1492
- }
1493
- };
1494
1507
  var Subscription = class extends HeyApiClient {
1495
1508
  /**
1496
1509
  * Get subscription details
@@ -1604,6 +1617,10 @@ var ZilfuApi = class _ZilfuApi extends HeyApiClient {
1604
1617
  get media() {
1605
1618
  return this._media ??= new Media({ client: this.client });
1606
1619
  }
1620
+ _organizations;
1621
+ get organizations() {
1622
+ return this._organizations ??= new Organizations({ client: this.client });
1623
+ }
1607
1624
  _posts;
1608
1625
  get posts() {
1609
1626
  return this._posts ??= new Posts({ client: this.client });
@@ -1628,14 +1645,6 @@ var ZilfuApi = class _ZilfuApi extends HeyApiClient {
1628
1645
  get spaces() {
1629
1646
  return this._spaces ??= new Spaces({ client: this.client });
1630
1647
  }
1631
- _invitations;
1632
- get invitations() {
1633
- return this._invitations ??= new Invitations({ client: this.client });
1634
- }
1635
- _members;
1636
- get members() {
1637
- return this._members ??= new Members({ client: this.client });
1638
- }
1639
1648
  _subscription;
1640
1649
  get subscription() {
1641
1650
  return this._subscription ??= new Subscription({ client: this.client });