@zilfu/sdk 0.2.21 → 0.2.23
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 +124 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +617 -532
- package/dist/index.d.ts +617 -532
- package/dist/index.js +124 -101
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1143,6 +1143,108 @@ var Media = class extends HeyApiClient {
|
|
|
1143
1143
|
});
|
|
1144
1144
|
}
|
|
1145
1145
|
};
|
|
1146
|
+
var Invitations = class extends HeyApiClient {
|
|
1147
|
+
/**
|
|
1148
|
+
* List pending invitations for an organization
|
|
1149
|
+
*/
|
|
1150
|
+
list(options) {
|
|
1151
|
+
return (options.client ?? this.client).get({
|
|
1152
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1153
|
+
url: "/organizations/{organization}/invitations",
|
|
1154
|
+
...options
|
|
1155
|
+
});
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Send an invitation
|
|
1159
|
+
*/
|
|
1160
|
+
create(options) {
|
|
1161
|
+
return (options.client ?? this.client).post({
|
|
1162
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1163
|
+
url: "/organizations/{organization}/invitations",
|
|
1164
|
+
...options,
|
|
1165
|
+
headers: {
|
|
1166
|
+
"Content-Type": "application/json",
|
|
1167
|
+
...options.headers
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Revoke a pending invitation
|
|
1173
|
+
*/
|
|
1174
|
+
delete(options) {
|
|
1175
|
+
return (options.client ?? this.client).delete({
|
|
1176
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1177
|
+
url: "/organizations/{organization}/invitations/{invitation}",
|
|
1178
|
+
...options
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Regenerate token + expiry and resend the invitation email
|
|
1183
|
+
*/
|
|
1184
|
+
resend(options) {
|
|
1185
|
+
return (options.client ?? this.client).post({
|
|
1186
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1187
|
+
url: "/organizations/{organization}/invitations/{invitation}/resend",
|
|
1188
|
+
...options
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
};
|
|
1192
|
+
var Members = class extends HeyApiClient {
|
|
1193
|
+
/**
|
|
1194
|
+
* List members of an organization
|
|
1195
|
+
*/
|
|
1196
|
+
list(options) {
|
|
1197
|
+
return (options.client ?? this.client).get({
|
|
1198
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1199
|
+
url: "/organizations/{organization}/members",
|
|
1200
|
+
...options
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* The authenticated user leaves the organization
|
|
1205
|
+
*/
|
|
1206
|
+
leave(options) {
|
|
1207
|
+
return (options.client ?? this.client).post({
|
|
1208
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1209
|
+
url: "/organizations/{organization}/members/leave",
|
|
1210
|
+
...options
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* Remove a member, and with them their access to every space
|
|
1215
|
+
*/
|
|
1216
|
+
delete(options) {
|
|
1217
|
+
return (options.client ?? this.client).delete({
|
|
1218
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1219
|
+
url: "/organizations/{organization}/members/{user}",
|
|
1220
|
+
...options
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Update a member's permissions across the organization
|
|
1225
|
+
*/
|
|
1226
|
+
update(options) {
|
|
1227
|
+
return (options.client ?? this.client).patch({
|
|
1228
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1229
|
+
url: "/organizations/{organization}/members/{user}",
|
|
1230
|
+
...options,
|
|
1231
|
+
headers: {
|
|
1232
|
+
"Content-Type": "application/json",
|
|
1233
|
+
...options.headers
|
|
1234
|
+
}
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
};
|
|
1238
|
+
var Organizations = class extends HeyApiClient {
|
|
1239
|
+
_invitations;
|
|
1240
|
+
get invitations() {
|
|
1241
|
+
return this._invitations ??= new Invitations({ client: this.client });
|
|
1242
|
+
}
|
|
1243
|
+
_members;
|
|
1244
|
+
get members() {
|
|
1245
|
+
return this._members ??= new Members({ client: this.client });
|
|
1246
|
+
}
|
|
1247
|
+
};
|
|
1146
1248
|
var Comment = class extends HeyApiClient {
|
|
1147
1249
|
/**
|
|
1148
1250
|
* Attach a follow-up comment to an existing post. If the post has already
|
|
@@ -1397,98 +1499,6 @@ var Spaces = class extends HeyApiClient {
|
|
|
1397
1499
|
});
|
|
1398
1500
|
}
|
|
1399
1501
|
};
|
|
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
1502
|
var Subscription = class extends HeyApiClient {
|
|
1493
1503
|
/**
|
|
1494
1504
|
* Get subscription details
|
|
@@ -1517,7 +1527,9 @@ var Webhooks = class extends HeyApiClient {
|
|
|
1517
1527
|
/**
|
|
1518
1528
|
* Create a webhook
|
|
1519
1529
|
*
|
|
1520
|
-
*
|
|
1530
|
+
* The response carries the generated signing secret alongside the webhook,
|
|
1531
|
+
* as a sibling of `data`. It is shown once and never returned by any other
|
|
1532
|
+
* endpoint — store it, or use the rotate endpoint to mint a replacement.
|
|
1521
1533
|
*/
|
|
1522
1534
|
create(options) {
|
|
1523
1535
|
return (options.client ?? this.client).post({
|
|
@@ -1554,6 +1566,21 @@ var Webhooks = class extends HeyApiClient {
|
|
|
1554
1566
|
}
|
|
1555
1567
|
});
|
|
1556
1568
|
}
|
|
1569
|
+
/**
|
|
1570
|
+
* Rotate a webhook's signing secret
|
|
1571
|
+
*
|
|
1572
|
+
* The only way back from a lost secret, since it is revealed once at
|
|
1573
|
+
* creation. Deliveries are signed with the new secret from the next event
|
|
1574
|
+
* onward, so a subscriber that verifies signatures should be updated first
|
|
1575
|
+
* — there is no grace period where both secrets are accepted.
|
|
1576
|
+
*/
|
|
1577
|
+
rotate(options) {
|
|
1578
|
+
return (options.client ?? this.client).post({
|
|
1579
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1580
|
+
url: "/spaces/{space}/webhooks/{webhook}/rotate",
|
|
1581
|
+
...options
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1557
1584
|
};
|
|
1558
1585
|
var ZilfuApi = class _ZilfuApi extends HeyApiClient {
|
|
1559
1586
|
static __registry = new HeyApiRegistry();
|
|
@@ -1585,6 +1612,10 @@ var ZilfuApi = class _ZilfuApi extends HeyApiClient {
|
|
|
1585
1612
|
get media() {
|
|
1586
1613
|
return this._media ??= new Media({ client: this.client });
|
|
1587
1614
|
}
|
|
1615
|
+
_organizations;
|
|
1616
|
+
get organizations() {
|
|
1617
|
+
return this._organizations ??= new Organizations({ client: this.client });
|
|
1618
|
+
}
|
|
1588
1619
|
_posts;
|
|
1589
1620
|
get posts() {
|
|
1590
1621
|
return this._posts ??= new Posts({ client: this.client });
|
|
@@ -1609,14 +1640,6 @@ var ZilfuApi = class _ZilfuApi extends HeyApiClient {
|
|
|
1609
1640
|
get spaces() {
|
|
1610
1641
|
return this._spaces ??= new Spaces({ client: this.client });
|
|
1611
1642
|
}
|
|
1612
|
-
_invitations;
|
|
1613
|
-
get invitations() {
|
|
1614
|
-
return this._invitations ??= new Invitations({ client: this.client });
|
|
1615
|
-
}
|
|
1616
|
-
_members;
|
|
1617
|
-
get members() {
|
|
1618
|
-
return this._members ??= new Members({ client: this.client });
|
|
1619
|
-
}
|
|
1620
1643
|
_subscription;
|
|
1621
1644
|
get subscription() {
|
|
1622
1645
|
return this._subscription ??= new Subscription({ client: this.client });
|