rotur-sdk 1.0.12 → 1.2.0
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 +134 -2
- package/dist/index.d.ts +134 -2
- package/dist/index.js +117 -2
- package/dist/index.mjs +117 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -187,6 +187,7 @@ interface PermissionGroup {
|
|
|
187
187
|
permissions: TokenPermission[];
|
|
188
188
|
}
|
|
189
189
|
interface GroupPublic {
|
|
190
|
+
id?: string;
|
|
190
191
|
tag: string;
|
|
191
192
|
name: string;
|
|
192
193
|
description: string;
|
|
@@ -230,13 +231,93 @@ interface GroupRole {
|
|
|
230
231
|
benefits: string[];
|
|
231
232
|
permissions: string[];
|
|
232
233
|
}
|
|
234
|
+
interface GroupMember {
|
|
235
|
+
id: string;
|
|
236
|
+
group_tag: string;
|
|
237
|
+
user_id: UserId;
|
|
238
|
+
username: Username;
|
|
239
|
+
role_ids: string[];
|
|
240
|
+
joined_at: number;
|
|
241
|
+
muted_announcements: boolean;
|
|
242
|
+
}
|
|
243
|
+
interface GroupMembersResponse {
|
|
244
|
+
members: GroupMember[];
|
|
245
|
+
page: number;
|
|
246
|
+
per_page: number;
|
|
247
|
+
total: number;
|
|
248
|
+
pages: number;
|
|
249
|
+
}
|
|
250
|
+
interface GroupInvite {
|
|
251
|
+
id: string;
|
|
252
|
+
group_tag: string;
|
|
253
|
+
from_user_id: UserId;
|
|
254
|
+
from_username: Username;
|
|
255
|
+
to_user_id: UserId;
|
|
256
|
+
to_username: Username;
|
|
257
|
+
status: "PENDING" | "ACCEPTED" | "DECLINED" | "REVOKED";
|
|
258
|
+
created_at: number;
|
|
259
|
+
}
|
|
260
|
+
interface GroupJoinRequest {
|
|
261
|
+
id: string;
|
|
262
|
+
group_tag: string;
|
|
263
|
+
user_id: UserId;
|
|
264
|
+
username: Username;
|
|
265
|
+
message: string;
|
|
266
|
+
status: "PENDING" | "ACCEPTED" | "DECLINED";
|
|
267
|
+
created_at: number;
|
|
268
|
+
}
|
|
269
|
+
interface GroupBan {
|
|
270
|
+
id: string;
|
|
271
|
+
group_tag: string;
|
|
272
|
+
user_id: UserId;
|
|
273
|
+
username: Username;
|
|
274
|
+
banned_by_id: UserId;
|
|
275
|
+
banned_by: Username;
|
|
276
|
+
reason: string;
|
|
277
|
+
created_at: number;
|
|
278
|
+
}
|
|
233
279
|
interface GroupTip {
|
|
234
280
|
id: string;
|
|
235
281
|
group_tag: string;
|
|
236
282
|
from_user_id: UserId;
|
|
283
|
+
from_username?: Username;
|
|
237
284
|
amount_credits: number;
|
|
285
|
+
note?: string;
|
|
238
286
|
created_at: number;
|
|
239
287
|
}
|
|
288
|
+
interface GroupProduct {
|
|
289
|
+
id: string;
|
|
290
|
+
group_tag: string;
|
|
291
|
+
name: string;
|
|
292
|
+
description: string;
|
|
293
|
+
price_credits: number;
|
|
294
|
+
role_granted_id?: string;
|
|
295
|
+
role_name?: string;
|
|
296
|
+
benefit_granted?: string;
|
|
297
|
+
subscription: boolean;
|
|
298
|
+
frequency?: number;
|
|
299
|
+
period?: "day" | "week" | "month" | "year";
|
|
300
|
+
}
|
|
301
|
+
interface GroupProductSubscription {
|
|
302
|
+
id: string;
|
|
303
|
+
group_tag: string;
|
|
304
|
+
product_id: string;
|
|
305
|
+
product_name: string;
|
|
306
|
+
username: Username;
|
|
307
|
+
role_id: string;
|
|
308
|
+
role_name: string;
|
|
309
|
+
started_at: number;
|
|
310
|
+
next_billing: number;
|
|
311
|
+
cancel_at?: number;
|
|
312
|
+
active: boolean;
|
|
313
|
+
}
|
|
314
|
+
interface GroupProductOwnership {
|
|
315
|
+
owned: boolean;
|
|
316
|
+
username: Username;
|
|
317
|
+
group_tag: string;
|
|
318
|
+
product: GroupProduct;
|
|
319
|
+
subscription?: GroupProductSubscription | null;
|
|
320
|
+
}
|
|
240
321
|
interface RoomMember {
|
|
241
322
|
user_id: UserId;
|
|
242
323
|
username: Username;
|
|
@@ -785,6 +866,8 @@ declare abstract class Namespace {
|
|
|
785
866
|
constructor(r: Rotur);
|
|
786
867
|
protected $get<T>(path: string, params?: Record<string, unknown>, auth?: boolean): Promise<T>;
|
|
787
868
|
protected $post<T>(path: string, body?: unknown, auth?: boolean): Promise<T>;
|
|
869
|
+
protected $postQuery<T>(path: string, params?: Record<string, unknown>, auth?: boolean): Promise<T>;
|
|
870
|
+
protected $delQuery<T>(path: string, params?: Record<string, unknown>, auth?: boolean): Promise<T>;
|
|
788
871
|
protected $patch<T>(path: string, body?: unknown): Promise<T>;
|
|
789
872
|
protected $del<T>(path: string, body?: unknown): Promise<T>;
|
|
790
873
|
}
|
|
@@ -1037,6 +1120,7 @@ declare class GroupsNamespace extends Namespace {
|
|
|
1037
1120
|
update(grouptag: string, updates: Record<string, unknown>): Promise<GroupPublic | ErrorResponse>;
|
|
1038
1121
|
delete(grouptag: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1039
1122
|
join(grouptag: string): Promise<GroupPublic | ErrorResponse>;
|
|
1123
|
+
requestJoin(grouptag: string, message?: string): Promise<GroupJoinRequest | ErrorResponse>;
|
|
1040
1124
|
leave(grouptag: string): Promise<GroupPublic | ErrorResponse>;
|
|
1041
1125
|
represent(grouptag: string): Promise<GroupRepresentResponse | ErrorResponse>;
|
|
1042
1126
|
disrepresent(grouptag: string): Promise<GroupRepresentResponse | ErrorResponse>;
|
|
@@ -1049,9 +1133,40 @@ declare class GroupsNamespace extends Namespace {
|
|
|
1049
1133
|
muteAnnouncements(grouptag: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1050
1134
|
events(grouptag: string): Promise<GroupEvent[]>;
|
|
1051
1135
|
createEvent(grouptag: string, event: Partial<GroupEvent>): Promise<GroupEvent>;
|
|
1136
|
+
updateEvent(grouptag: string, eventId: string, updates: Partial<GroupEvent>): Promise<GroupEvent>;
|
|
1137
|
+
deleteEvent(grouptag: string, eventId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1052
1138
|
tips(grouptag: string): Promise<GroupTip[]>;
|
|
1053
|
-
sendTip(grouptag: string, amount: number): Promise<GroupTip | ErrorResponse>;
|
|
1139
|
+
sendTip(grouptag: string, amount: number, note?: string): Promise<GroupTip | ErrorResponse>;
|
|
1140
|
+
products(grouptag: string): Promise<GroupProduct[]>;
|
|
1141
|
+
createProduct(grouptag: string, product: {
|
|
1142
|
+
name: string;
|
|
1143
|
+
priceCredits: number;
|
|
1144
|
+
roleId: string;
|
|
1145
|
+
description?: string;
|
|
1146
|
+
subscription?: boolean;
|
|
1147
|
+
frequency?: number;
|
|
1148
|
+
period?: "day" | "week" | "month" | "year";
|
|
1149
|
+
}): Promise<GroupProduct>;
|
|
1150
|
+
deleteProduct(grouptag: string, productId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1151
|
+
purchaseProduct(grouptag: string, productId: string): Promise<{
|
|
1152
|
+
message: string;
|
|
1153
|
+
product: GroupProduct;
|
|
1154
|
+
subscription?: GroupProductSubscription | null;
|
|
1155
|
+
group: GroupPublic;
|
|
1156
|
+
} | ErrorResponse>;
|
|
1157
|
+
cancelProductSubscription(grouptag: string, productId: string): Promise<{
|
|
1158
|
+
status: string;
|
|
1159
|
+
cancel_at: number;
|
|
1160
|
+
subscription: GroupProductSubscription;
|
|
1161
|
+
} | ErrorResponse>;
|
|
1162
|
+
productOwnership(grouptag: string, productId: string, username: Username): Promise<GroupProductOwnership>;
|
|
1163
|
+
myProductSubscriptions(): Promise<GroupProductSubscription[]>;
|
|
1054
1164
|
roles(grouptag: string): Promise<GroupRole[]>;
|
|
1165
|
+
members(grouptag: string, options?: {
|
|
1166
|
+
page?: number;
|
|
1167
|
+
perPage?: number;
|
|
1168
|
+
search?: string;
|
|
1169
|
+
}): Promise<GroupMembersResponse>;
|
|
1055
1170
|
createRole(grouptag: string, role: Partial<GroupRole>): Promise<GroupRole>;
|
|
1056
1171
|
updateRole(grouptag: string, roleId: string, updates: Partial<GroupRole>): Promise<GroupRole>;
|
|
1057
1172
|
deleteRole(grouptag: string, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
@@ -1060,6 +1175,23 @@ declare class GroupsNamespace extends Namespace {
|
|
|
1060
1175
|
userBenefits(grouptag: string, userId: UserId): Promise<string[]>;
|
|
1061
1176
|
assignRole(grouptag: string, userId: UserId, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1062
1177
|
removeRole(grouptag: string, userId: UserId, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1178
|
+
invites(grouptag: string): Promise<GroupInvite[]>;
|
|
1179
|
+
invite(grouptag: string, username: Username): Promise<GroupInvite | ErrorResponse>;
|
|
1180
|
+
revokeInvite(grouptag: string, inviteId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1181
|
+
myInvites(): Promise<GroupInvite[]>;
|
|
1182
|
+
acceptInvite(grouptag: string, inviteId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1183
|
+
declineInvite(grouptag: string, inviteId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1184
|
+
joinRequests(grouptag: string): Promise<GroupJoinRequest[]>;
|
|
1185
|
+
acceptJoinRequest(grouptag: string, requestId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1186
|
+
declineJoinRequest(grouptag: string, requestId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1187
|
+
kick(grouptag: string, userId: UserId): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1188
|
+
ban(grouptag: string, userId: UserId, reason?: string): Promise<{
|
|
1189
|
+
message: string;
|
|
1190
|
+
ban: GroupBan;
|
|
1191
|
+
} | ErrorResponse>;
|
|
1192
|
+
unban(grouptag: string, userId: UserId): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1193
|
+
bans(grouptag: string): Promise<GroupBan[]>;
|
|
1194
|
+
transferOwnership(grouptag: string, userId: UserId): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1063
1195
|
}
|
|
1064
1196
|
declare class SystemsNamespace extends Namespace {
|
|
1065
1197
|
list(): Promise<Record<string, System>>;
|
|
@@ -1230,4 +1362,4 @@ interface IconToSvgOptions {
|
|
|
1230
1362
|
}
|
|
1231
1363
|
declare function iconToSvg(iconString: string, options?: IconToSvgOptions): string;
|
|
1232
1364
|
|
|
1233
|
-
export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckAuthResponseFull, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type ErrorResponse, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type FileUsageResponse, type FollowResponse, type FriendActionResponse, type GiftCancelResponse, type GiftClaimResponse, type GiftCreateResponse, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupEvent, type GroupMessageResponse, type GroupPublic, type GroupRepresentResponse, type GroupRole, type GroupTip, type ItemBuyResponse, type ItemDeleteResponse, type ItemSellResponse, type ItemSetPriceResponse, type ItemStopSellingResponse, type ItemTransferResponse, type JoinPolicy, type KeyBuyResponse, type KeyCancelSubscriptionResponse, type KeyCheckResponse, type KeyCreateResponse, type KeyPublic, type KeyStatusResponse, type KeySubscription, type KeyUserData, type LimitsResponse, type MeDeleteAccountResponse, type MeDeleteKeyResponse, type MeTransferResponse, type MeUpdateResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type PostDeleteResponse, type PostPinResponse, type PostRateResponse, type Presence, type PushAllowSenderResponse, type PushCheckResponse, type PushDeleteDeviceResponse, type PushRegisterResponse, type PushSendManyResponse, type PushSendResponse, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type SystemUpdateResponse, type TokenAbilities, type TokenActivityResponse, type TokenDeleteResponse, type TokenPermission, type TokenRenameResponse, type TokenRevokeResponse, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage$1 as WSMessage, iconToSvg, performAuth };
|
|
1365
|
+
export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckAuthResponseFull, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type ErrorResponse, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type FileUsageResponse, type FollowResponse, type FriendActionResponse, type GiftCancelResponse, type GiftClaimResponse, type GiftCreateResponse, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupBan, type GroupEvent, type GroupInvite, type GroupJoinRequest, type GroupMember, type GroupMembersResponse, type GroupMessageResponse, type GroupProduct, type GroupProductOwnership, type GroupProductSubscription, type GroupPublic, type GroupRepresentResponse, type GroupRole, type GroupTip, type ItemBuyResponse, type ItemDeleteResponse, type ItemSellResponse, type ItemSetPriceResponse, type ItemStopSellingResponse, type ItemTransferResponse, type JoinPolicy, type KeyBuyResponse, type KeyCancelSubscriptionResponse, type KeyCheckResponse, type KeyCreateResponse, type KeyPublic, type KeyStatusResponse, type KeySubscription, type KeyUserData, type LimitsResponse, type MeDeleteAccountResponse, type MeDeleteKeyResponse, type MeTransferResponse, type MeUpdateResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type PostDeleteResponse, type PostPinResponse, type PostRateResponse, type Presence, type PushAllowSenderResponse, type PushCheckResponse, type PushDeleteDeviceResponse, type PushRegisterResponse, type PushSendManyResponse, type PushSendResponse, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type SystemUpdateResponse, type TokenAbilities, type TokenActivityResponse, type TokenDeleteResponse, type TokenPermission, type TokenRenameResponse, type TokenRevokeResponse, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage$1 as WSMessage, iconToSvg, performAuth };
|
package/dist/index.d.ts
CHANGED
|
@@ -187,6 +187,7 @@ interface PermissionGroup {
|
|
|
187
187
|
permissions: TokenPermission[];
|
|
188
188
|
}
|
|
189
189
|
interface GroupPublic {
|
|
190
|
+
id?: string;
|
|
190
191
|
tag: string;
|
|
191
192
|
name: string;
|
|
192
193
|
description: string;
|
|
@@ -230,13 +231,93 @@ interface GroupRole {
|
|
|
230
231
|
benefits: string[];
|
|
231
232
|
permissions: string[];
|
|
232
233
|
}
|
|
234
|
+
interface GroupMember {
|
|
235
|
+
id: string;
|
|
236
|
+
group_tag: string;
|
|
237
|
+
user_id: UserId;
|
|
238
|
+
username: Username;
|
|
239
|
+
role_ids: string[];
|
|
240
|
+
joined_at: number;
|
|
241
|
+
muted_announcements: boolean;
|
|
242
|
+
}
|
|
243
|
+
interface GroupMembersResponse {
|
|
244
|
+
members: GroupMember[];
|
|
245
|
+
page: number;
|
|
246
|
+
per_page: number;
|
|
247
|
+
total: number;
|
|
248
|
+
pages: number;
|
|
249
|
+
}
|
|
250
|
+
interface GroupInvite {
|
|
251
|
+
id: string;
|
|
252
|
+
group_tag: string;
|
|
253
|
+
from_user_id: UserId;
|
|
254
|
+
from_username: Username;
|
|
255
|
+
to_user_id: UserId;
|
|
256
|
+
to_username: Username;
|
|
257
|
+
status: "PENDING" | "ACCEPTED" | "DECLINED" | "REVOKED";
|
|
258
|
+
created_at: number;
|
|
259
|
+
}
|
|
260
|
+
interface GroupJoinRequest {
|
|
261
|
+
id: string;
|
|
262
|
+
group_tag: string;
|
|
263
|
+
user_id: UserId;
|
|
264
|
+
username: Username;
|
|
265
|
+
message: string;
|
|
266
|
+
status: "PENDING" | "ACCEPTED" | "DECLINED";
|
|
267
|
+
created_at: number;
|
|
268
|
+
}
|
|
269
|
+
interface GroupBan {
|
|
270
|
+
id: string;
|
|
271
|
+
group_tag: string;
|
|
272
|
+
user_id: UserId;
|
|
273
|
+
username: Username;
|
|
274
|
+
banned_by_id: UserId;
|
|
275
|
+
banned_by: Username;
|
|
276
|
+
reason: string;
|
|
277
|
+
created_at: number;
|
|
278
|
+
}
|
|
233
279
|
interface GroupTip {
|
|
234
280
|
id: string;
|
|
235
281
|
group_tag: string;
|
|
236
282
|
from_user_id: UserId;
|
|
283
|
+
from_username?: Username;
|
|
237
284
|
amount_credits: number;
|
|
285
|
+
note?: string;
|
|
238
286
|
created_at: number;
|
|
239
287
|
}
|
|
288
|
+
interface GroupProduct {
|
|
289
|
+
id: string;
|
|
290
|
+
group_tag: string;
|
|
291
|
+
name: string;
|
|
292
|
+
description: string;
|
|
293
|
+
price_credits: number;
|
|
294
|
+
role_granted_id?: string;
|
|
295
|
+
role_name?: string;
|
|
296
|
+
benefit_granted?: string;
|
|
297
|
+
subscription: boolean;
|
|
298
|
+
frequency?: number;
|
|
299
|
+
period?: "day" | "week" | "month" | "year";
|
|
300
|
+
}
|
|
301
|
+
interface GroupProductSubscription {
|
|
302
|
+
id: string;
|
|
303
|
+
group_tag: string;
|
|
304
|
+
product_id: string;
|
|
305
|
+
product_name: string;
|
|
306
|
+
username: Username;
|
|
307
|
+
role_id: string;
|
|
308
|
+
role_name: string;
|
|
309
|
+
started_at: number;
|
|
310
|
+
next_billing: number;
|
|
311
|
+
cancel_at?: number;
|
|
312
|
+
active: boolean;
|
|
313
|
+
}
|
|
314
|
+
interface GroupProductOwnership {
|
|
315
|
+
owned: boolean;
|
|
316
|
+
username: Username;
|
|
317
|
+
group_tag: string;
|
|
318
|
+
product: GroupProduct;
|
|
319
|
+
subscription?: GroupProductSubscription | null;
|
|
320
|
+
}
|
|
240
321
|
interface RoomMember {
|
|
241
322
|
user_id: UserId;
|
|
242
323
|
username: Username;
|
|
@@ -785,6 +866,8 @@ declare abstract class Namespace {
|
|
|
785
866
|
constructor(r: Rotur);
|
|
786
867
|
protected $get<T>(path: string, params?: Record<string, unknown>, auth?: boolean): Promise<T>;
|
|
787
868
|
protected $post<T>(path: string, body?: unknown, auth?: boolean): Promise<T>;
|
|
869
|
+
protected $postQuery<T>(path: string, params?: Record<string, unknown>, auth?: boolean): Promise<T>;
|
|
870
|
+
protected $delQuery<T>(path: string, params?: Record<string, unknown>, auth?: boolean): Promise<T>;
|
|
788
871
|
protected $patch<T>(path: string, body?: unknown): Promise<T>;
|
|
789
872
|
protected $del<T>(path: string, body?: unknown): Promise<T>;
|
|
790
873
|
}
|
|
@@ -1037,6 +1120,7 @@ declare class GroupsNamespace extends Namespace {
|
|
|
1037
1120
|
update(grouptag: string, updates: Record<string, unknown>): Promise<GroupPublic | ErrorResponse>;
|
|
1038
1121
|
delete(grouptag: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1039
1122
|
join(grouptag: string): Promise<GroupPublic | ErrorResponse>;
|
|
1123
|
+
requestJoin(grouptag: string, message?: string): Promise<GroupJoinRequest | ErrorResponse>;
|
|
1040
1124
|
leave(grouptag: string): Promise<GroupPublic | ErrorResponse>;
|
|
1041
1125
|
represent(grouptag: string): Promise<GroupRepresentResponse | ErrorResponse>;
|
|
1042
1126
|
disrepresent(grouptag: string): Promise<GroupRepresentResponse | ErrorResponse>;
|
|
@@ -1049,9 +1133,40 @@ declare class GroupsNamespace extends Namespace {
|
|
|
1049
1133
|
muteAnnouncements(grouptag: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1050
1134
|
events(grouptag: string): Promise<GroupEvent[]>;
|
|
1051
1135
|
createEvent(grouptag: string, event: Partial<GroupEvent>): Promise<GroupEvent>;
|
|
1136
|
+
updateEvent(grouptag: string, eventId: string, updates: Partial<GroupEvent>): Promise<GroupEvent>;
|
|
1137
|
+
deleteEvent(grouptag: string, eventId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1052
1138
|
tips(grouptag: string): Promise<GroupTip[]>;
|
|
1053
|
-
sendTip(grouptag: string, amount: number): Promise<GroupTip | ErrorResponse>;
|
|
1139
|
+
sendTip(grouptag: string, amount: number, note?: string): Promise<GroupTip | ErrorResponse>;
|
|
1140
|
+
products(grouptag: string): Promise<GroupProduct[]>;
|
|
1141
|
+
createProduct(grouptag: string, product: {
|
|
1142
|
+
name: string;
|
|
1143
|
+
priceCredits: number;
|
|
1144
|
+
roleId: string;
|
|
1145
|
+
description?: string;
|
|
1146
|
+
subscription?: boolean;
|
|
1147
|
+
frequency?: number;
|
|
1148
|
+
period?: "day" | "week" | "month" | "year";
|
|
1149
|
+
}): Promise<GroupProduct>;
|
|
1150
|
+
deleteProduct(grouptag: string, productId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1151
|
+
purchaseProduct(grouptag: string, productId: string): Promise<{
|
|
1152
|
+
message: string;
|
|
1153
|
+
product: GroupProduct;
|
|
1154
|
+
subscription?: GroupProductSubscription | null;
|
|
1155
|
+
group: GroupPublic;
|
|
1156
|
+
} | ErrorResponse>;
|
|
1157
|
+
cancelProductSubscription(grouptag: string, productId: string): Promise<{
|
|
1158
|
+
status: string;
|
|
1159
|
+
cancel_at: number;
|
|
1160
|
+
subscription: GroupProductSubscription;
|
|
1161
|
+
} | ErrorResponse>;
|
|
1162
|
+
productOwnership(grouptag: string, productId: string, username: Username): Promise<GroupProductOwnership>;
|
|
1163
|
+
myProductSubscriptions(): Promise<GroupProductSubscription[]>;
|
|
1054
1164
|
roles(grouptag: string): Promise<GroupRole[]>;
|
|
1165
|
+
members(grouptag: string, options?: {
|
|
1166
|
+
page?: number;
|
|
1167
|
+
perPage?: number;
|
|
1168
|
+
search?: string;
|
|
1169
|
+
}): Promise<GroupMembersResponse>;
|
|
1055
1170
|
createRole(grouptag: string, role: Partial<GroupRole>): Promise<GroupRole>;
|
|
1056
1171
|
updateRole(grouptag: string, roleId: string, updates: Partial<GroupRole>): Promise<GroupRole>;
|
|
1057
1172
|
deleteRole(grouptag: string, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
@@ -1060,6 +1175,23 @@ declare class GroupsNamespace extends Namespace {
|
|
|
1060
1175
|
userBenefits(grouptag: string, userId: UserId): Promise<string[]>;
|
|
1061
1176
|
assignRole(grouptag: string, userId: UserId, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1062
1177
|
removeRole(grouptag: string, userId: UserId, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1178
|
+
invites(grouptag: string): Promise<GroupInvite[]>;
|
|
1179
|
+
invite(grouptag: string, username: Username): Promise<GroupInvite | ErrorResponse>;
|
|
1180
|
+
revokeInvite(grouptag: string, inviteId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1181
|
+
myInvites(): Promise<GroupInvite[]>;
|
|
1182
|
+
acceptInvite(grouptag: string, inviteId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1183
|
+
declineInvite(grouptag: string, inviteId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1184
|
+
joinRequests(grouptag: string): Promise<GroupJoinRequest[]>;
|
|
1185
|
+
acceptJoinRequest(grouptag: string, requestId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1186
|
+
declineJoinRequest(grouptag: string, requestId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1187
|
+
kick(grouptag: string, userId: UserId): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1188
|
+
ban(grouptag: string, userId: UserId, reason?: string): Promise<{
|
|
1189
|
+
message: string;
|
|
1190
|
+
ban: GroupBan;
|
|
1191
|
+
} | ErrorResponse>;
|
|
1192
|
+
unban(grouptag: string, userId: UserId): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1193
|
+
bans(grouptag: string): Promise<GroupBan[]>;
|
|
1194
|
+
transferOwnership(grouptag: string, userId: UserId): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1063
1195
|
}
|
|
1064
1196
|
declare class SystemsNamespace extends Namespace {
|
|
1065
1197
|
list(): Promise<Record<string, System>>;
|
|
@@ -1230,4 +1362,4 @@ interface IconToSvgOptions {
|
|
|
1230
1362
|
}
|
|
1231
1363
|
declare function iconToSvg(iconString: string, options?: IconToSvgOptions): string;
|
|
1232
1364
|
|
|
1233
|
-
export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckAuthResponseFull, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type ErrorResponse, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type FileUsageResponse, type FollowResponse, type FriendActionResponse, type GiftCancelResponse, type GiftClaimResponse, type GiftCreateResponse, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupEvent, type GroupMessageResponse, type GroupPublic, type GroupRepresentResponse, type GroupRole, type GroupTip, type ItemBuyResponse, type ItemDeleteResponse, type ItemSellResponse, type ItemSetPriceResponse, type ItemStopSellingResponse, type ItemTransferResponse, type JoinPolicy, type KeyBuyResponse, type KeyCancelSubscriptionResponse, type KeyCheckResponse, type KeyCreateResponse, type KeyPublic, type KeyStatusResponse, type KeySubscription, type KeyUserData, type LimitsResponse, type MeDeleteAccountResponse, type MeDeleteKeyResponse, type MeTransferResponse, type MeUpdateResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type PostDeleteResponse, type PostPinResponse, type PostRateResponse, type Presence, type PushAllowSenderResponse, type PushCheckResponse, type PushDeleteDeviceResponse, type PushRegisterResponse, type PushSendManyResponse, type PushSendResponse, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type SystemUpdateResponse, type TokenAbilities, type TokenActivityResponse, type TokenDeleteResponse, type TokenPermission, type TokenRenameResponse, type TokenRevokeResponse, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage$1 as WSMessage, iconToSvg, performAuth };
|
|
1365
|
+
export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckAuthResponseFull, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type ErrorResponse, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type FileUsageResponse, type FollowResponse, type FriendActionResponse, type GiftCancelResponse, type GiftClaimResponse, type GiftCreateResponse, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupBan, type GroupEvent, type GroupInvite, type GroupJoinRequest, type GroupMember, type GroupMembersResponse, type GroupMessageResponse, type GroupProduct, type GroupProductOwnership, type GroupProductSubscription, type GroupPublic, type GroupRepresentResponse, type GroupRole, type GroupTip, type ItemBuyResponse, type ItemDeleteResponse, type ItemSellResponse, type ItemSetPriceResponse, type ItemStopSellingResponse, type ItemTransferResponse, type JoinPolicy, type KeyBuyResponse, type KeyCancelSubscriptionResponse, type KeyCheckResponse, type KeyCreateResponse, type KeyPublic, type KeyStatusResponse, type KeySubscription, type KeyUserData, type LimitsResponse, type MeDeleteAccountResponse, type MeDeleteKeyResponse, type MeTransferResponse, type MeUpdateResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type PostDeleteResponse, type PostPinResponse, type PostRateResponse, type Presence, type PushAllowSenderResponse, type PushCheckResponse, type PushDeleteDeviceResponse, type PushRegisterResponse, type PushSendManyResponse, type PushSendResponse, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type SystemUpdateResponse, type TokenAbilities, type TokenActivityResponse, type TokenDeleteResponse, type TokenPermission, type TokenRenameResponse, type TokenRevokeResponse, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage$1 as WSMessage, iconToSvg, performAuth };
|
package/dist/index.js
CHANGED
|
@@ -475,6 +475,28 @@ var Namespace = class {
|
|
|
475
475
|
$post(path, body, auth = true) {
|
|
476
476
|
return this.r._http.post(path, body, auth);
|
|
477
477
|
}
|
|
478
|
+
$postQuery(path, params, auth = true) {
|
|
479
|
+
const query = new URLSearchParams();
|
|
480
|
+
for (const [key, value] of Object.entries(params || {})) {
|
|
481
|
+
if (value === void 0 || value === null) continue;
|
|
482
|
+
query.set(key, String(value));
|
|
483
|
+
}
|
|
484
|
+
const token = auth ? this.r.token : null;
|
|
485
|
+
if (token) query.set("auth", token);
|
|
486
|
+
const suffix = query.toString();
|
|
487
|
+
return this.r._http.post(`${path}${suffix ? `?${suffix}` : ""}`, void 0, false);
|
|
488
|
+
}
|
|
489
|
+
$delQuery(path, params, auth = true) {
|
|
490
|
+
const query = new URLSearchParams();
|
|
491
|
+
for (const [key, value] of Object.entries(params || {})) {
|
|
492
|
+
if (value === void 0 || value === null) continue;
|
|
493
|
+
query.set(key, String(value));
|
|
494
|
+
}
|
|
495
|
+
const token = auth ? this.r.token : null;
|
|
496
|
+
if (token) query.set("auth", token);
|
|
497
|
+
const suffix = query.toString();
|
|
498
|
+
return this.r._http.del(`${path}${suffix ? `?${suffix}` : ""}`, void 0);
|
|
499
|
+
}
|
|
478
500
|
$patch(path, body) {
|
|
479
501
|
return this.r._http.patch(path, body);
|
|
480
502
|
}
|
|
@@ -854,6 +876,9 @@ var GroupsNamespace = class extends Namespace {
|
|
|
854
876
|
async join(grouptag) {
|
|
855
877
|
return this.$post(`/groups/${grouptag}/join`);
|
|
856
878
|
}
|
|
879
|
+
async requestJoin(grouptag, message) {
|
|
880
|
+
return this.$postQuery(`/groups/${grouptag}/join_requests`, { message });
|
|
881
|
+
}
|
|
857
882
|
async leave(grouptag) {
|
|
858
883
|
return this.$post(`/groups/${grouptag}/leave`);
|
|
859
884
|
}
|
|
@@ -888,15 +913,61 @@ var GroupsNamespace = class extends Namespace {
|
|
|
888
913
|
async createEvent(grouptag, event) {
|
|
889
914
|
return this.$post(`/groups/${grouptag}/events`, event);
|
|
890
915
|
}
|
|
916
|
+
async updateEvent(grouptag, eventId, updates) {
|
|
917
|
+
return this.$patch(`/groups/${grouptag}/events/${eventId}`, updates);
|
|
918
|
+
}
|
|
919
|
+
async deleteEvent(grouptag, eventId) {
|
|
920
|
+
return this.$del(`/groups/${grouptag}/events/${eventId}`);
|
|
921
|
+
}
|
|
891
922
|
async tips(grouptag) {
|
|
892
923
|
return this.$get(`/groups/${grouptag}/tips`);
|
|
893
924
|
}
|
|
894
|
-
async sendTip(grouptag, amount) {
|
|
895
|
-
return this.$
|
|
925
|
+
async sendTip(grouptag, amount, note) {
|
|
926
|
+
return this.$postQuery(`/groups/${grouptag}/tips`, { amount, note });
|
|
927
|
+
}
|
|
928
|
+
async products(grouptag) {
|
|
929
|
+
return this.$get(`/groups/${grouptag}/products`);
|
|
930
|
+
}
|
|
931
|
+
async createProduct(grouptag, product) {
|
|
932
|
+
return this.$postQuery(`/groups/${grouptag}/products`, {
|
|
933
|
+
name: product.name,
|
|
934
|
+
description: product.description,
|
|
935
|
+
price_credits: product.priceCredits,
|
|
936
|
+
role_id: product.roleId,
|
|
937
|
+
subscription: product.subscription,
|
|
938
|
+
frequency: product.frequency,
|
|
939
|
+
period: product.period
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
async deleteProduct(grouptag, productId) {
|
|
943
|
+
return this.$del(`/groups/${grouptag}/products/${productId}`);
|
|
944
|
+
}
|
|
945
|
+
async purchaseProduct(grouptag, productId) {
|
|
946
|
+
return this.$post(`/groups/${grouptag}/products/${productId}/purchase`);
|
|
947
|
+
}
|
|
948
|
+
async cancelProductSubscription(grouptag, productId) {
|
|
949
|
+
return this.$post(`/groups/${grouptag}/products/${productId}/cancel`);
|
|
950
|
+
}
|
|
951
|
+
async productOwnership(grouptag, productId, username) {
|
|
952
|
+
return this.$get(
|
|
953
|
+
`/groups/${grouptag}/products/${productId}/owners/${username}`,
|
|
954
|
+
void 0,
|
|
955
|
+
false
|
|
956
|
+
);
|
|
957
|
+
}
|
|
958
|
+
async myProductSubscriptions() {
|
|
959
|
+
return this.$get("/groups/products/subscriptions/mine");
|
|
896
960
|
}
|
|
897
961
|
async roles(grouptag) {
|
|
898
962
|
return this.$get(`/groups/${grouptag}/roles`);
|
|
899
963
|
}
|
|
964
|
+
async members(grouptag, options) {
|
|
965
|
+
return this.$get(`/groups/${grouptag}/members`, {
|
|
966
|
+
page: options?.page,
|
|
967
|
+
per_page: options?.perPage,
|
|
968
|
+
search: options?.search
|
|
969
|
+
});
|
|
970
|
+
}
|
|
900
971
|
async createRole(grouptag, role) {
|
|
901
972
|
return this.$post(`/groups/${grouptag}/roles`, role);
|
|
902
973
|
}
|
|
@@ -921,6 +992,50 @@ var GroupsNamespace = class extends Namespace {
|
|
|
921
992
|
async removeRole(grouptag, userId, roleId) {
|
|
922
993
|
return this.$del(`/groups/${grouptag}/members/${userId}/roles/${roleId}`);
|
|
923
994
|
}
|
|
995
|
+
async invites(grouptag) {
|
|
996
|
+
return this.$get(`/groups/${grouptag}/invites`);
|
|
997
|
+
}
|
|
998
|
+
async invite(grouptag, username) {
|
|
999
|
+
return this.$postQuery(`/groups/${grouptag}/invites`, { username });
|
|
1000
|
+
}
|
|
1001
|
+
async revokeInvite(grouptag, inviteId) {
|
|
1002
|
+
return this.$del(`/groups/${grouptag}/invites/${inviteId}`);
|
|
1003
|
+
}
|
|
1004
|
+
async myInvites() {
|
|
1005
|
+
return this.$get("/groups/invites/mine");
|
|
1006
|
+
}
|
|
1007
|
+
async acceptInvite(grouptag, inviteId) {
|
|
1008
|
+
return this.$post(`/groups/${grouptag}/invites/${inviteId}/accept`);
|
|
1009
|
+
}
|
|
1010
|
+
async declineInvite(grouptag, inviteId) {
|
|
1011
|
+
return this.$post(`/groups/${grouptag}/invites/${inviteId}/decline`);
|
|
1012
|
+
}
|
|
1013
|
+
async joinRequests(grouptag) {
|
|
1014
|
+
return this.$get(`/groups/${grouptag}/join_requests`);
|
|
1015
|
+
}
|
|
1016
|
+
async acceptJoinRequest(grouptag, requestId) {
|
|
1017
|
+
return this.$post(`/groups/${grouptag}/join_requests/${requestId}/accept`);
|
|
1018
|
+
}
|
|
1019
|
+
async declineJoinRequest(grouptag, requestId) {
|
|
1020
|
+
return this.$post(`/groups/${grouptag}/join_requests/${requestId}/decline`);
|
|
1021
|
+
}
|
|
1022
|
+
async kick(grouptag, userId) {
|
|
1023
|
+
return this.$del(`/groups/${grouptag}/members/${userId}`);
|
|
1024
|
+
}
|
|
1025
|
+
async ban(grouptag, userId, reason) {
|
|
1026
|
+
return this.$postQuery(`/groups/${grouptag}/members/${userId}/ban`, {
|
|
1027
|
+
reason
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
async unban(grouptag, userId) {
|
|
1031
|
+
return this.$del(`/groups/${grouptag}/members/${userId}/ban`);
|
|
1032
|
+
}
|
|
1033
|
+
async bans(grouptag) {
|
|
1034
|
+
return this.$get(`/groups/${grouptag}/bans`);
|
|
1035
|
+
}
|
|
1036
|
+
async transferOwnership(grouptag, userId) {
|
|
1037
|
+
return this.$post(`/groups/${grouptag}/transfer/${userId}`);
|
|
1038
|
+
}
|
|
924
1039
|
};
|
|
925
1040
|
var SystemsNamespace = class extends Namespace {
|
|
926
1041
|
async list() {
|
package/dist/index.mjs
CHANGED
|
@@ -444,6 +444,28 @@ var Namespace = class {
|
|
|
444
444
|
$post(path, body, auth = true) {
|
|
445
445
|
return this.r._http.post(path, body, auth);
|
|
446
446
|
}
|
|
447
|
+
$postQuery(path, params, auth = true) {
|
|
448
|
+
const query = new URLSearchParams();
|
|
449
|
+
for (const [key, value] of Object.entries(params || {})) {
|
|
450
|
+
if (value === void 0 || value === null) continue;
|
|
451
|
+
query.set(key, String(value));
|
|
452
|
+
}
|
|
453
|
+
const token = auth ? this.r.token : null;
|
|
454
|
+
if (token) query.set("auth", token);
|
|
455
|
+
const suffix = query.toString();
|
|
456
|
+
return this.r._http.post(`${path}${suffix ? `?${suffix}` : ""}`, void 0, false);
|
|
457
|
+
}
|
|
458
|
+
$delQuery(path, params, auth = true) {
|
|
459
|
+
const query = new URLSearchParams();
|
|
460
|
+
for (const [key, value] of Object.entries(params || {})) {
|
|
461
|
+
if (value === void 0 || value === null) continue;
|
|
462
|
+
query.set(key, String(value));
|
|
463
|
+
}
|
|
464
|
+
const token = auth ? this.r.token : null;
|
|
465
|
+
if (token) query.set("auth", token);
|
|
466
|
+
const suffix = query.toString();
|
|
467
|
+
return this.r._http.del(`${path}${suffix ? `?${suffix}` : ""}`, void 0);
|
|
468
|
+
}
|
|
447
469
|
$patch(path, body) {
|
|
448
470
|
return this.r._http.patch(path, body);
|
|
449
471
|
}
|
|
@@ -823,6 +845,9 @@ var GroupsNamespace = class extends Namespace {
|
|
|
823
845
|
async join(grouptag) {
|
|
824
846
|
return this.$post(`/groups/${grouptag}/join`);
|
|
825
847
|
}
|
|
848
|
+
async requestJoin(grouptag, message) {
|
|
849
|
+
return this.$postQuery(`/groups/${grouptag}/join_requests`, { message });
|
|
850
|
+
}
|
|
826
851
|
async leave(grouptag) {
|
|
827
852
|
return this.$post(`/groups/${grouptag}/leave`);
|
|
828
853
|
}
|
|
@@ -857,15 +882,61 @@ var GroupsNamespace = class extends Namespace {
|
|
|
857
882
|
async createEvent(grouptag, event) {
|
|
858
883
|
return this.$post(`/groups/${grouptag}/events`, event);
|
|
859
884
|
}
|
|
885
|
+
async updateEvent(grouptag, eventId, updates) {
|
|
886
|
+
return this.$patch(`/groups/${grouptag}/events/${eventId}`, updates);
|
|
887
|
+
}
|
|
888
|
+
async deleteEvent(grouptag, eventId) {
|
|
889
|
+
return this.$del(`/groups/${grouptag}/events/${eventId}`);
|
|
890
|
+
}
|
|
860
891
|
async tips(grouptag) {
|
|
861
892
|
return this.$get(`/groups/${grouptag}/tips`);
|
|
862
893
|
}
|
|
863
|
-
async sendTip(grouptag, amount) {
|
|
864
|
-
return this.$
|
|
894
|
+
async sendTip(grouptag, amount, note) {
|
|
895
|
+
return this.$postQuery(`/groups/${grouptag}/tips`, { amount, note });
|
|
896
|
+
}
|
|
897
|
+
async products(grouptag) {
|
|
898
|
+
return this.$get(`/groups/${grouptag}/products`);
|
|
899
|
+
}
|
|
900
|
+
async createProduct(grouptag, product) {
|
|
901
|
+
return this.$postQuery(`/groups/${grouptag}/products`, {
|
|
902
|
+
name: product.name,
|
|
903
|
+
description: product.description,
|
|
904
|
+
price_credits: product.priceCredits,
|
|
905
|
+
role_id: product.roleId,
|
|
906
|
+
subscription: product.subscription,
|
|
907
|
+
frequency: product.frequency,
|
|
908
|
+
period: product.period
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
async deleteProduct(grouptag, productId) {
|
|
912
|
+
return this.$del(`/groups/${grouptag}/products/${productId}`);
|
|
913
|
+
}
|
|
914
|
+
async purchaseProduct(grouptag, productId) {
|
|
915
|
+
return this.$post(`/groups/${grouptag}/products/${productId}/purchase`);
|
|
916
|
+
}
|
|
917
|
+
async cancelProductSubscription(grouptag, productId) {
|
|
918
|
+
return this.$post(`/groups/${grouptag}/products/${productId}/cancel`);
|
|
919
|
+
}
|
|
920
|
+
async productOwnership(grouptag, productId, username) {
|
|
921
|
+
return this.$get(
|
|
922
|
+
`/groups/${grouptag}/products/${productId}/owners/${username}`,
|
|
923
|
+
void 0,
|
|
924
|
+
false
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
async myProductSubscriptions() {
|
|
928
|
+
return this.$get("/groups/products/subscriptions/mine");
|
|
865
929
|
}
|
|
866
930
|
async roles(grouptag) {
|
|
867
931
|
return this.$get(`/groups/${grouptag}/roles`);
|
|
868
932
|
}
|
|
933
|
+
async members(grouptag, options) {
|
|
934
|
+
return this.$get(`/groups/${grouptag}/members`, {
|
|
935
|
+
page: options?.page,
|
|
936
|
+
per_page: options?.perPage,
|
|
937
|
+
search: options?.search
|
|
938
|
+
});
|
|
939
|
+
}
|
|
869
940
|
async createRole(grouptag, role) {
|
|
870
941
|
return this.$post(`/groups/${grouptag}/roles`, role);
|
|
871
942
|
}
|
|
@@ -890,6 +961,50 @@ var GroupsNamespace = class extends Namespace {
|
|
|
890
961
|
async removeRole(grouptag, userId, roleId) {
|
|
891
962
|
return this.$del(`/groups/${grouptag}/members/${userId}/roles/${roleId}`);
|
|
892
963
|
}
|
|
964
|
+
async invites(grouptag) {
|
|
965
|
+
return this.$get(`/groups/${grouptag}/invites`);
|
|
966
|
+
}
|
|
967
|
+
async invite(grouptag, username) {
|
|
968
|
+
return this.$postQuery(`/groups/${grouptag}/invites`, { username });
|
|
969
|
+
}
|
|
970
|
+
async revokeInvite(grouptag, inviteId) {
|
|
971
|
+
return this.$del(`/groups/${grouptag}/invites/${inviteId}`);
|
|
972
|
+
}
|
|
973
|
+
async myInvites() {
|
|
974
|
+
return this.$get("/groups/invites/mine");
|
|
975
|
+
}
|
|
976
|
+
async acceptInvite(grouptag, inviteId) {
|
|
977
|
+
return this.$post(`/groups/${grouptag}/invites/${inviteId}/accept`);
|
|
978
|
+
}
|
|
979
|
+
async declineInvite(grouptag, inviteId) {
|
|
980
|
+
return this.$post(`/groups/${grouptag}/invites/${inviteId}/decline`);
|
|
981
|
+
}
|
|
982
|
+
async joinRequests(grouptag) {
|
|
983
|
+
return this.$get(`/groups/${grouptag}/join_requests`);
|
|
984
|
+
}
|
|
985
|
+
async acceptJoinRequest(grouptag, requestId) {
|
|
986
|
+
return this.$post(`/groups/${grouptag}/join_requests/${requestId}/accept`);
|
|
987
|
+
}
|
|
988
|
+
async declineJoinRequest(grouptag, requestId) {
|
|
989
|
+
return this.$post(`/groups/${grouptag}/join_requests/${requestId}/decline`);
|
|
990
|
+
}
|
|
991
|
+
async kick(grouptag, userId) {
|
|
992
|
+
return this.$del(`/groups/${grouptag}/members/${userId}`);
|
|
993
|
+
}
|
|
994
|
+
async ban(grouptag, userId, reason) {
|
|
995
|
+
return this.$postQuery(`/groups/${grouptag}/members/${userId}/ban`, {
|
|
996
|
+
reason
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
async unban(grouptag, userId) {
|
|
1000
|
+
return this.$del(`/groups/${grouptag}/members/${userId}/ban`);
|
|
1001
|
+
}
|
|
1002
|
+
async bans(grouptag) {
|
|
1003
|
+
return this.$get(`/groups/${grouptag}/bans`);
|
|
1004
|
+
}
|
|
1005
|
+
async transferOwnership(grouptag, userId) {
|
|
1006
|
+
return this.$post(`/groups/${grouptag}/transfer/${userId}`);
|
|
1007
|
+
}
|
|
893
1008
|
};
|
|
894
1009
|
var SystemsNamespace = class extends Namespace {
|
|
895
1010
|
async list() {
|