att-client
Advanced tools
Comparing version 0.5.2-beta.1 to 0.5.2-beta.2
@@ -37,8 +37,28 @@ "use strict"; | ||
async getJoinedGroups() { | ||
const response = await this.request('GET', "/groups/joined", undefined, { limit: 1000 }); | ||
return await response.json(); | ||
const joinedGroups = []; | ||
let response; | ||
let paginationToken = null; | ||
do { | ||
response = await this.request('GET', "/groups/joined", undefined, { | ||
limit: 1000, | ||
...(paginationToken === null ? {} : { paginationToken }) | ||
}); | ||
paginationToken = response.headers.get('paginationToken'); | ||
joinedGroups.push(...(await response.json())); | ||
} while (paginationToken !== null); | ||
return joinedGroups; | ||
} | ||
async getPendingGroupInvites() { | ||
const response = await this.request('GET', "/groups/invites", undefined, { limit: 1000 }); | ||
return await response.json(); | ||
const pendingInvites = []; | ||
let response; | ||
let paginationToken = null; | ||
do { | ||
response = await this.request('GET', "/groups/invites", undefined, { | ||
limit: 1000, | ||
...(paginationToken === null ? {} : { paginationToken }) | ||
}); | ||
paginationToken = response.headers.get('paginationToken'); | ||
pendingInvites.push(...(await response.json())); | ||
} while (paginationToken !== null); | ||
return pendingInvites; | ||
} | ||
@@ -45,0 +65,0 @@ async getServerConnectionDetails(serverId) { |
@@ -7,3 +7,3 @@ "use strict"; | ||
name: 'att-client', | ||
version: '0.5.2-beta.1' | ||
version: '0.5.2-beta.2' | ||
}; | ||
@@ -10,0 +10,0 @@ const SECOND = 1000; |
@@ -34,8 +34,28 @@ import './Endpoint.js'; | ||
async getJoinedGroups() { | ||
const response = await this.request('GET', "/groups/joined", undefined, { limit: 1000 }); | ||
return await response.json(); | ||
const joinedGroups = []; | ||
let response; | ||
let paginationToken = null; | ||
do { | ||
response = await this.request('GET', "/groups/joined", undefined, { | ||
limit: 1000, | ||
...(paginationToken === null ? {} : { paginationToken }) | ||
}); | ||
paginationToken = response.headers.get('paginationToken'); | ||
joinedGroups.push(...(await response.json())); | ||
} while (paginationToken !== null); | ||
return joinedGroups; | ||
} | ||
async getPendingGroupInvites() { | ||
const response = await this.request('GET', "/groups/invites", undefined, { limit: 1000 }); | ||
return await response.json(); | ||
const pendingInvites = []; | ||
let response; | ||
let paginationToken = null; | ||
do { | ||
response = await this.request('GET', "/groups/invites", undefined, { | ||
limit: 1000, | ||
...(paginationToken === null ? {} : { paginationToken }) | ||
}); | ||
paginationToken = response.headers.get('paginationToken'); | ||
pendingInvites.push(...(await response.json())); | ||
} while (paginationToken !== null); | ||
return pendingInvites; | ||
} | ||
@@ -42,0 +62,0 @@ async getServerConnectionDetails(serverId) { |
import './Logger/index.js'; | ||
export const AGENT = { | ||
name: 'att-client', | ||
version: '0.5.2-beta.1' | ||
version: '0.5.2-beta.2' | ||
}; | ||
@@ -6,0 +6,0 @@ const SECOND = 1000; |
import type { Client } from '../Client/index.js'; | ||
import type { InvitedGroupInfo } from './schemas/InvitedGroupInfo.js'; | ||
import type { JoinedGroupInfo } from './schemas/JoinedGroupInfo.js'; | ||
export declare class Api { | ||
@@ -10,4 +12,4 @@ client: Client; | ||
getGroupMember(groupId: number, userId: string): Promise<import("./index.js").GroupMemberInfo>; | ||
getJoinedGroups(): Promise<import("./index.js").JoinedGroupInfo[]>; | ||
getPendingGroupInvites(): Promise<import("./index.js").InvitedGroupInfo[]>; | ||
getJoinedGroups(): Promise<JoinedGroupInfo[]>; | ||
getPendingGroupInvites(): Promise<InvitedGroupInfo[]>; | ||
getServerConnectionDetails(serverId: number): Promise<import("./index.js").ServerConnectionInfo>; | ||
@@ -14,0 +16,0 @@ getServerInfo(serverId: number): Promise<import("./index.js").ServerInfo>; |
{ | ||
"name": "att-client", | ||
"version": "0.5.2-beta.1", | ||
"version": "0.5.2-beta.2", | ||
"description": "Node bot library for A Township Tale, a VR game by Alta", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/mdingena/att-client#readme", |
180768
3986