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