rotur-sdk 1.0.3 → 1.0.5
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/README.md +29 -18
- package/dist/index.d.mts +57 -34
- package/dist/index.d.ts +57 -34
- package/dist/index.js +27 -15
- package/dist/index.mjs +27 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,8 +31,8 @@ const rotur = new Rotur({ token: "your-token-here" });
|
|
|
31
31
|
await rotur.login({ system: "my-app", timeout: 60_000 });
|
|
32
32
|
|
|
33
33
|
// Check current auth state
|
|
34
|
-
rotur.loggedIn;
|
|
35
|
-
rotur.token;
|
|
34
|
+
rotur.loggedIn; // boolean
|
|
35
|
+
rotur.token; // string | null
|
|
36
36
|
|
|
37
37
|
// Set/refresh token manually
|
|
38
38
|
rotur.setToken("new-token");
|
|
@@ -117,7 +117,11 @@ await rotur.keys.buy("key-id");
|
|
|
117
117
|
### Items
|
|
118
118
|
|
|
119
119
|
```ts
|
|
120
|
-
const item = await rotur.items.create({
|
|
120
|
+
const item = await rotur.items.create({
|
|
121
|
+
name: "sword",
|
|
122
|
+
price: 100,
|
|
123
|
+
selling: true,
|
|
124
|
+
});
|
|
121
125
|
const item = await rotur.items.get("sword");
|
|
122
126
|
const items = await rotur.items.list("username");
|
|
123
127
|
await rotur.items.buy("sword");
|
|
@@ -138,9 +142,11 @@ await rotur.gifts.claim("code");
|
|
|
138
142
|
const { permissions, groups } = await rotur.tokens.permissions();
|
|
139
143
|
const { tokens } = await rotur.tokens.list();
|
|
140
144
|
|
|
141
|
-
const sub = await rotur.tokens.create(
|
|
142
|
-
"
|
|
143
|
-
|
|
145
|
+
const sub = await rotur.tokens.create(
|
|
146
|
+
"bot-token",
|
|
147
|
+
["posts:view", "posts:create", "account:profile"],
|
|
148
|
+
{ expiresInHrs: 24, origin: "my-app" },
|
|
149
|
+
);
|
|
144
150
|
|
|
145
151
|
await rotur.tokens.revoke(sub.id);
|
|
146
152
|
```
|
|
@@ -178,7 +184,9 @@ const files = await rotur.files.index();
|
|
|
178
184
|
const { used, max } = await rotur.files.usage();
|
|
179
185
|
const file = await rotur.files.getByUUID("uuid");
|
|
180
186
|
const file = await rotur.files.getByPath("path/to/file");
|
|
181
|
-
await rotur.files.upload({
|
|
187
|
+
await rotur.files.upload({
|
|
188
|
+
/* file data */
|
|
189
|
+
});
|
|
182
190
|
```
|
|
183
191
|
|
|
184
192
|
### Push Notifications
|
|
@@ -187,7 +195,10 @@ await rotur.files.upload({ /* file data */ });
|
|
|
187
195
|
const { public_key } = await rotur.push.vapidKeys();
|
|
188
196
|
await rotur.push.register(endpoint, p256dh, auth, "my-app", "fingerprint");
|
|
189
197
|
const { endpoints } = await rotur.push.endpoints();
|
|
190
|
-
await rotur.push.send("username", "my-app", {
|
|
198
|
+
await rotur.push.send("username", "my-app", {
|
|
199
|
+
title: "Hi!",
|
|
200
|
+
body: "You have a message",
|
|
201
|
+
});
|
|
191
202
|
```
|
|
192
203
|
|
|
193
204
|
### Status & Validators
|
|
@@ -262,8 +273,8 @@ try {
|
|
|
262
273
|
await rotur.me.transfer("user", 1000);
|
|
263
274
|
} catch (e) {
|
|
264
275
|
if (e instanceof ApiError) {
|
|
265
|
-
console.log(e.status);
|
|
266
|
-
console.log(e.data);
|
|
276
|
+
console.log(e.status); // HTTP status code
|
|
277
|
+
console.log(e.data); // response body
|
|
267
278
|
console.log(e.message); // human-readable error
|
|
268
279
|
}
|
|
269
280
|
}
|
|
@@ -288,14 +299,14 @@ npm test # vitest
|
|
|
288
299
|
|
|
289
300
|
## Exports
|
|
290
301
|
|
|
291
|
-
| Export
|
|
292
|
-
|
|
293
|
-
| `Rotur`
|
|
294
|
-
| `RoturSocket`
|
|
295
|
-
| `ApiError`
|
|
296
|
-
| `performAuth`, `AuthError`
|
|
297
|
-
| `AuthOptions`, `AuthResult` | Auth option types
|
|
298
|
-
| All types from `types.ts`
|
|
302
|
+
| Export | Description |
|
|
303
|
+
| --------------------------- | ---------------------------------------------------------- |
|
|
304
|
+
| `Rotur` | Main client class |
|
|
305
|
+
| `RoturSocket` | WebSocket connection (real-time presence) |
|
|
306
|
+
| `ApiError` | HTTP error with `status` and `data` |
|
|
307
|
+
| `performAuth`, `AuthError` | Browser auth flow |
|
|
308
|
+
| `AuthOptions`, `AuthResult` | Auth option types |
|
|
309
|
+
| All types from `types.ts` | `UserProfile`, `NetPost`, `GroupPublic`, `WSMessage`, etc. |
|
|
299
310
|
|
|
300
311
|
## License
|
|
301
312
|
|
package/dist/index.d.mts
CHANGED
|
@@ -21,6 +21,9 @@ type Presence = "online" | "idle" | "dnd" | "invisible";
|
|
|
21
21
|
type StandingLevel = "good" | "warning" | "suspended" | "banned";
|
|
22
22
|
type JoinPolicy = "OPEN" | "REQUEST" | "INVITE";
|
|
23
23
|
type TokenPermission = "account:delete" | "account:profile" | "account:settings" | "account:view" | "credits:view" | "credits:manage" | "credits:transfer" | "credits:daily" | "friends:view" | "friends:manage" | "friends:request" | "friends:accept" | "friends:remove" | "posts:view" | "posts:create" | "posts:delete" | "posts:manage" | "posts:like" | "posts:reply" | "posts:repost" | "following:view" | "following:follow" | "following:unfollow" | "files:view" | "files:manage" | "files:delete" | "keys:view" | "keys:manage" | "groups:view" | "groups:manage" | "groups:join" | "groups:leave" | "notifications:view" | "notifications:send" | "gifts:view" | "gifts:create" | "gifts:claim" | "gifts:cancel" | "items:view" | "items:buy" | "items:sell" | "items:manage" | "validators:generate" | "blocked:view" | "blocked:manage" | "tokens:manage" | "cosmetics:view" | "cosmetics:buy" | "cosmetics:equip";
|
|
24
|
+
interface ErrorResponse {
|
|
25
|
+
error: string;
|
|
26
|
+
}
|
|
24
27
|
interface UserProfile {
|
|
25
28
|
username: Username;
|
|
26
29
|
pfp: string;
|
|
@@ -50,7 +53,7 @@ interface Badge {
|
|
|
50
53
|
icon: string;
|
|
51
54
|
description: string;
|
|
52
55
|
}
|
|
53
|
-
|
|
56
|
+
type Transaction = {
|
|
54
57
|
type: string;
|
|
55
58
|
user: Username;
|
|
56
59
|
amount: number;
|
|
@@ -60,9 +63,7 @@ interface Transaction {
|
|
|
60
63
|
petition_id?: string;
|
|
61
64
|
key_name?: string;
|
|
62
65
|
key_id?: string;
|
|
63
|
-
|
|
64
|
-
gift_code?: string;
|
|
65
|
-
}
|
|
66
|
+
};
|
|
66
67
|
interface NetPost {
|
|
67
68
|
id: string;
|
|
68
69
|
content: string;
|
|
@@ -619,47 +620,69 @@ declare class ProfilesNamespace extends Namespace {
|
|
|
619
620
|
getBannerUrl(username: Username, cache?: string): string;
|
|
620
621
|
}
|
|
621
622
|
declare class MeNamespace extends Namespace {
|
|
622
|
-
get(): Promise<Record<string, any
|
|
623
|
-
update(key: string, value:
|
|
624
|
-
|
|
623
|
+
get(): Promise<Record<string, any> | ErrorResponse>;
|
|
624
|
+
update<T>(key: string, value: T): Promise<{
|
|
625
|
+
message: string;
|
|
626
|
+
username: string;
|
|
627
|
+
key: string;
|
|
628
|
+
value: T;
|
|
629
|
+
} | ErrorResponse>;
|
|
630
|
+
deleteKey(key: string): Promise<{
|
|
631
|
+
message: string;
|
|
632
|
+
username: string;
|
|
633
|
+
key: string;
|
|
634
|
+
} | ErrorResponse>;
|
|
625
635
|
deleteAccount(): Promise<any>;
|
|
626
636
|
refreshToken(): Promise<{
|
|
627
637
|
token: string;
|
|
628
|
-
}>;
|
|
638
|
+
} | ErrorResponse>;
|
|
629
639
|
getKey(key: string): any;
|
|
630
640
|
getAllKeys(): Record<string, any>;
|
|
631
641
|
onKeyChange(callback: (key: string, value: any, oldValue: any) => void): () => void;
|
|
632
|
-
transfer(to: Username, amount: number, note?: string): Promise<
|
|
633
|
-
claimDaily(): Promise<{
|
|
642
|
+
transfer(to: Username, amount: number, note?: string): Promise<{
|
|
634
643
|
message: string;
|
|
635
|
-
|
|
644
|
+
from: string;
|
|
645
|
+
to: string;
|
|
646
|
+
amount: number;
|
|
647
|
+
debited: number;
|
|
648
|
+
} | ErrorResponse>;
|
|
649
|
+
claimDaily(): Promise<{
|
|
650
|
+
error: "Daily claim already made";
|
|
651
|
+
wait_time: number;
|
|
652
|
+
wait_hours: string;
|
|
653
|
+
} | {
|
|
654
|
+
response: "Daily claim successful";
|
|
655
|
+
} | ErrorResponse>;
|
|
636
656
|
claimTime(): Promise<{
|
|
637
657
|
wait_time: number;
|
|
638
|
-
}>;
|
|
658
|
+
} | ErrorResponse>;
|
|
639
659
|
badges(): Promise<{
|
|
640
660
|
badge_names: string[];
|
|
641
|
-
}>;
|
|
642
|
-
|
|
643
|
-
message: string;
|
|
644
|
-
}>;
|
|
645
|
-
abilities(): Promise<TokenAbilities>;
|
|
661
|
+
} | ErrorResponse>;
|
|
662
|
+
abilities(): Promise<TokenAbilities | ErrorResponse>;
|
|
646
663
|
blocked(): Promise<{
|
|
647
664
|
blocked: Username[];
|
|
648
|
-
}>;
|
|
649
|
-
block(username: Username): Promise<
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
665
|
+
} | ErrorResponse>;
|
|
666
|
+
block(username: Username): Promise<{
|
|
667
|
+
message: "User blocked";
|
|
668
|
+
} | ErrorResponse>;
|
|
669
|
+
unblock(username: Username): Promise<{
|
|
670
|
+
message: "User unblocked";
|
|
671
|
+
} | ErrorResponse>;
|
|
672
|
+
note(username: Username, content: string): Promise<{
|
|
673
|
+
success: true;
|
|
674
|
+
} | ErrorResponse>;
|
|
675
|
+
deleteNote(username: Username): Promise<{
|
|
676
|
+
success: true;
|
|
677
|
+
} | ErrorResponse>;
|
|
655
678
|
checkAuth(): Promise<CheckAuthResponse>;
|
|
656
679
|
requests(): Promise<{
|
|
657
680
|
requests: Username[];
|
|
658
|
-
}>;
|
|
681
|
+
} | ErrorResponse>;
|
|
659
682
|
outgoing(): Promise<{
|
|
660
683
|
outgoing: Username[];
|
|
661
|
-
}>;
|
|
662
|
-
transactions(): Promise<
|
|
684
|
+
} | ErrorResponse>;
|
|
685
|
+
transactions(): Promise<Transaction[]>;
|
|
663
686
|
subscription(): Promise<{
|
|
664
687
|
active: boolean;
|
|
665
688
|
tier: string;
|
|
@@ -910,16 +933,16 @@ declare class CosmeticsNamespace extends Namespace {
|
|
|
910
933
|
limit?: number;
|
|
911
934
|
offset?: number;
|
|
912
935
|
}): Promise<ShopResponse>;
|
|
913
|
-
get(id: string): Promise<CosmeticCatalogEntryPublic>;
|
|
914
|
-
mine(): Promise<MyCosmeticsResponse>;
|
|
915
|
-
purchase(id: string): Promise<CosmeticPurchaseResult>;
|
|
936
|
+
get(id: string): Promise<CosmeticCatalogEntryPublic | ErrorResponse>;
|
|
937
|
+
mine(): Promise<MyCosmeticsResponse | ErrorResponse>;
|
|
938
|
+
purchase(id: string): Promise<CosmeticPurchaseResult | ErrorResponse>;
|
|
916
939
|
equip(id: string): Promise<{
|
|
917
940
|
message: string;
|
|
918
|
-
}>;
|
|
941
|
+
} | ErrorResponse>;
|
|
919
942
|
unequip(type: string): Promise<{
|
|
920
943
|
message: string;
|
|
921
|
-
}>;
|
|
922
|
-
overlays(
|
|
944
|
+
} | ErrorResponse>;
|
|
945
|
+
overlays(name: string): Promise<Response>;
|
|
923
946
|
}
|
|
924
947
|
declare class PushNamespace extends Namespace {
|
|
925
948
|
vapidKeys(): Promise<{
|
|
@@ -1006,4 +1029,4 @@ declare class AuthError extends Error {
|
|
|
1006
1029
|
}
|
|
1007
1030
|
declare function performAuth(options?: AuthOptions): Promise<AuthResult>;
|
|
1008
1031
|
|
|
1009
|
-
export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupEvent, type GroupPublic, type GroupRole, type GroupTip, type JoinPolicy, type KeyPublic, type KeySubscription, type KeyUserData, type LimitsResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type Presence, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type TokenAbilities, type TokenPermission, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage, performAuth };
|
|
1032
|
+
export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type ErrorResponse, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupEvent, type GroupPublic, type GroupRole, type GroupTip, type JoinPolicy, type KeyPublic, type KeySubscription, type KeyUserData, type LimitsResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type Presence, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type TokenAbilities, type TokenPermission, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage, performAuth };
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ type Presence = "online" | "idle" | "dnd" | "invisible";
|
|
|
21
21
|
type StandingLevel = "good" | "warning" | "suspended" | "banned";
|
|
22
22
|
type JoinPolicy = "OPEN" | "REQUEST" | "INVITE";
|
|
23
23
|
type TokenPermission = "account:delete" | "account:profile" | "account:settings" | "account:view" | "credits:view" | "credits:manage" | "credits:transfer" | "credits:daily" | "friends:view" | "friends:manage" | "friends:request" | "friends:accept" | "friends:remove" | "posts:view" | "posts:create" | "posts:delete" | "posts:manage" | "posts:like" | "posts:reply" | "posts:repost" | "following:view" | "following:follow" | "following:unfollow" | "files:view" | "files:manage" | "files:delete" | "keys:view" | "keys:manage" | "groups:view" | "groups:manage" | "groups:join" | "groups:leave" | "notifications:view" | "notifications:send" | "gifts:view" | "gifts:create" | "gifts:claim" | "gifts:cancel" | "items:view" | "items:buy" | "items:sell" | "items:manage" | "validators:generate" | "blocked:view" | "blocked:manage" | "tokens:manage" | "cosmetics:view" | "cosmetics:buy" | "cosmetics:equip";
|
|
24
|
+
interface ErrorResponse {
|
|
25
|
+
error: string;
|
|
26
|
+
}
|
|
24
27
|
interface UserProfile {
|
|
25
28
|
username: Username;
|
|
26
29
|
pfp: string;
|
|
@@ -50,7 +53,7 @@ interface Badge {
|
|
|
50
53
|
icon: string;
|
|
51
54
|
description: string;
|
|
52
55
|
}
|
|
53
|
-
|
|
56
|
+
type Transaction = {
|
|
54
57
|
type: string;
|
|
55
58
|
user: Username;
|
|
56
59
|
amount: number;
|
|
@@ -60,9 +63,7 @@ interface Transaction {
|
|
|
60
63
|
petition_id?: string;
|
|
61
64
|
key_name?: string;
|
|
62
65
|
key_id?: string;
|
|
63
|
-
|
|
64
|
-
gift_code?: string;
|
|
65
|
-
}
|
|
66
|
+
};
|
|
66
67
|
interface NetPost {
|
|
67
68
|
id: string;
|
|
68
69
|
content: string;
|
|
@@ -619,47 +620,69 @@ declare class ProfilesNamespace extends Namespace {
|
|
|
619
620
|
getBannerUrl(username: Username, cache?: string): string;
|
|
620
621
|
}
|
|
621
622
|
declare class MeNamespace extends Namespace {
|
|
622
|
-
get(): Promise<Record<string, any
|
|
623
|
-
update(key: string, value:
|
|
624
|
-
|
|
623
|
+
get(): Promise<Record<string, any> | ErrorResponse>;
|
|
624
|
+
update<T>(key: string, value: T): Promise<{
|
|
625
|
+
message: string;
|
|
626
|
+
username: string;
|
|
627
|
+
key: string;
|
|
628
|
+
value: T;
|
|
629
|
+
} | ErrorResponse>;
|
|
630
|
+
deleteKey(key: string): Promise<{
|
|
631
|
+
message: string;
|
|
632
|
+
username: string;
|
|
633
|
+
key: string;
|
|
634
|
+
} | ErrorResponse>;
|
|
625
635
|
deleteAccount(): Promise<any>;
|
|
626
636
|
refreshToken(): Promise<{
|
|
627
637
|
token: string;
|
|
628
|
-
}>;
|
|
638
|
+
} | ErrorResponse>;
|
|
629
639
|
getKey(key: string): any;
|
|
630
640
|
getAllKeys(): Record<string, any>;
|
|
631
641
|
onKeyChange(callback: (key: string, value: any, oldValue: any) => void): () => void;
|
|
632
|
-
transfer(to: Username, amount: number, note?: string): Promise<
|
|
633
|
-
claimDaily(): Promise<{
|
|
642
|
+
transfer(to: Username, amount: number, note?: string): Promise<{
|
|
634
643
|
message: string;
|
|
635
|
-
|
|
644
|
+
from: string;
|
|
645
|
+
to: string;
|
|
646
|
+
amount: number;
|
|
647
|
+
debited: number;
|
|
648
|
+
} | ErrorResponse>;
|
|
649
|
+
claimDaily(): Promise<{
|
|
650
|
+
error: "Daily claim already made";
|
|
651
|
+
wait_time: number;
|
|
652
|
+
wait_hours: string;
|
|
653
|
+
} | {
|
|
654
|
+
response: "Daily claim successful";
|
|
655
|
+
} | ErrorResponse>;
|
|
636
656
|
claimTime(): Promise<{
|
|
637
657
|
wait_time: number;
|
|
638
|
-
}>;
|
|
658
|
+
} | ErrorResponse>;
|
|
639
659
|
badges(): Promise<{
|
|
640
660
|
badge_names: string[];
|
|
641
|
-
}>;
|
|
642
|
-
|
|
643
|
-
message: string;
|
|
644
|
-
}>;
|
|
645
|
-
abilities(): Promise<TokenAbilities>;
|
|
661
|
+
} | ErrorResponse>;
|
|
662
|
+
abilities(): Promise<TokenAbilities | ErrorResponse>;
|
|
646
663
|
blocked(): Promise<{
|
|
647
664
|
blocked: Username[];
|
|
648
|
-
}>;
|
|
649
|
-
block(username: Username): Promise<
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
665
|
+
} | ErrorResponse>;
|
|
666
|
+
block(username: Username): Promise<{
|
|
667
|
+
message: "User blocked";
|
|
668
|
+
} | ErrorResponse>;
|
|
669
|
+
unblock(username: Username): Promise<{
|
|
670
|
+
message: "User unblocked";
|
|
671
|
+
} | ErrorResponse>;
|
|
672
|
+
note(username: Username, content: string): Promise<{
|
|
673
|
+
success: true;
|
|
674
|
+
} | ErrorResponse>;
|
|
675
|
+
deleteNote(username: Username): Promise<{
|
|
676
|
+
success: true;
|
|
677
|
+
} | ErrorResponse>;
|
|
655
678
|
checkAuth(): Promise<CheckAuthResponse>;
|
|
656
679
|
requests(): Promise<{
|
|
657
680
|
requests: Username[];
|
|
658
|
-
}>;
|
|
681
|
+
} | ErrorResponse>;
|
|
659
682
|
outgoing(): Promise<{
|
|
660
683
|
outgoing: Username[];
|
|
661
|
-
}>;
|
|
662
|
-
transactions(): Promise<
|
|
684
|
+
} | ErrorResponse>;
|
|
685
|
+
transactions(): Promise<Transaction[]>;
|
|
663
686
|
subscription(): Promise<{
|
|
664
687
|
active: boolean;
|
|
665
688
|
tier: string;
|
|
@@ -910,16 +933,16 @@ declare class CosmeticsNamespace extends Namespace {
|
|
|
910
933
|
limit?: number;
|
|
911
934
|
offset?: number;
|
|
912
935
|
}): Promise<ShopResponse>;
|
|
913
|
-
get(id: string): Promise<CosmeticCatalogEntryPublic>;
|
|
914
|
-
mine(): Promise<MyCosmeticsResponse>;
|
|
915
|
-
purchase(id: string): Promise<CosmeticPurchaseResult>;
|
|
936
|
+
get(id: string): Promise<CosmeticCatalogEntryPublic | ErrorResponse>;
|
|
937
|
+
mine(): Promise<MyCosmeticsResponse | ErrorResponse>;
|
|
938
|
+
purchase(id: string): Promise<CosmeticPurchaseResult | ErrorResponse>;
|
|
916
939
|
equip(id: string): Promise<{
|
|
917
940
|
message: string;
|
|
918
|
-
}>;
|
|
941
|
+
} | ErrorResponse>;
|
|
919
942
|
unequip(type: string): Promise<{
|
|
920
943
|
message: string;
|
|
921
|
-
}>;
|
|
922
|
-
overlays(
|
|
944
|
+
} | ErrorResponse>;
|
|
945
|
+
overlays(name: string): Promise<Response>;
|
|
923
946
|
}
|
|
924
947
|
declare class PushNamespace extends Namespace {
|
|
925
948
|
vapidKeys(): Promise<{
|
|
@@ -1006,4 +1029,4 @@ declare class AuthError extends Error {
|
|
|
1006
1029
|
}
|
|
1007
1030
|
declare function performAuth(options?: AuthOptions): Promise<AuthResult>;
|
|
1008
1031
|
|
|
1009
|
-
export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupEvent, type GroupPublic, type GroupRole, type GroupTip, type JoinPolicy, type KeyPublic, type KeySubscription, type KeyUserData, type LimitsResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type Presence, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type TokenAbilities, type TokenPermission, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage, performAuth };
|
|
1032
|
+
export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type ErrorResponse, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupEvent, type GroupPublic, type GroupRole, type GroupTip, type JoinPolicy, type KeyPublic, type KeySubscription, type KeyUserData, type LimitsResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type Presence, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type TokenAbilities, type TokenPermission, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage, performAuth };
|
package/dist/index.js
CHANGED
|
@@ -526,9 +526,6 @@ var MeNamespace = class extends Namespace {
|
|
|
526
526
|
async badges() {
|
|
527
527
|
return this.$get("/badges");
|
|
528
528
|
}
|
|
529
|
-
async acceptTos() {
|
|
530
|
-
return this.$post("/accept_tos");
|
|
531
|
-
}
|
|
532
529
|
async abilities() {
|
|
533
530
|
return this.$get("/me/able");
|
|
534
531
|
}
|
|
@@ -547,12 +544,6 @@ var MeNamespace = class extends Namespace {
|
|
|
547
544
|
async deleteNote(username) {
|
|
548
545
|
return this.$del(`/me/note/${username}`);
|
|
549
546
|
}
|
|
550
|
-
async resendVerification() {
|
|
551
|
-
return this.$post("/me/resend_verification");
|
|
552
|
-
}
|
|
553
|
-
async verifyEmail(token) {
|
|
554
|
-
return this.$get("/verify_email", { token }, false);
|
|
555
|
-
}
|
|
556
547
|
async checkAuth() {
|
|
557
548
|
return this.$get("/check_auth");
|
|
558
549
|
}
|
|
@@ -567,10 +558,18 @@ var MeNamespace = class extends Namespace {
|
|
|
567
558
|
}));
|
|
568
559
|
}
|
|
569
560
|
async transactions() {
|
|
570
|
-
return this.$get("/me", void 0).then(
|
|
561
|
+
return this.$get("/me", void 0).then(
|
|
562
|
+
(u) => u["sys.transactions"] ?? []
|
|
563
|
+
);
|
|
571
564
|
}
|
|
572
565
|
async subscription() {
|
|
573
|
-
return this.$get("/me", void 0).then(
|
|
566
|
+
return this.$get("/me", void 0).then(
|
|
567
|
+
(u) => u["sys.subscription"] ?? {
|
|
568
|
+
active: false,
|
|
569
|
+
tier: "Free",
|
|
570
|
+
next_billing: 0
|
|
571
|
+
}
|
|
572
|
+
);
|
|
574
573
|
}
|
|
575
574
|
};
|
|
576
575
|
var PostsNamespace = class extends Namespace {
|
|
@@ -1003,8 +1002,12 @@ var CosmeticsNamespace = class extends Namespace {
|
|
|
1003
1002
|
async unequip(type) {
|
|
1004
1003
|
return this.$post(`/cosmetics/unequip?type=${encodeURIComponent(type)}`);
|
|
1005
1004
|
}
|
|
1006
|
-
async overlays(
|
|
1007
|
-
return this.$get(
|
|
1005
|
+
async overlays(name) {
|
|
1006
|
+
return this.$get(
|
|
1007
|
+
`/cosmetics/overlays/${name}.gif`,
|
|
1008
|
+
void 0,
|
|
1009
|
+
false
|
|
1010
|
+
);
|
|
1008
1011
|
}
|
|
1009
1012
|
};
|
|
1010
1013
|
var PushNamespace = class extends Namespace {
|
|
@@ -1102,11 +1105,20 @@ var StandingNamespace = class extends Namespace {
|
|
|
1102
1105
|
var DevFundNamespace = class extends Namespace {
|
|
1103
1106
|
/** Transfer credits to escrow for a dev fund petition */
|
|
1104
1107
|
async escrowTransfer(amount, petitionId, note) {
|
|
1105
|
-
return this.$post("/devfund/escrow_transfer", {
|
|
1108
|
+
return this.$post("/devfund/escrow_transfer", {
|
|
1109
|
+
amount,
|
|
1110
|
+
petition_id: petitionId,
|
|
1111
|
+
note
|
|
1112
|
+
});
|
|
1106
1113
|
}
|
|
1107
1114
|
/** Release escrow credits to a developer (admin only) */
|
|
1108
1115
|
async escrowRelease(amount, toUsername, petitionId, note) {
|
|
1109
|
-
return this.$post("/devfund/escrow_release", {
|
|
1116
|
+
return this.$post("/devfund/escrow_release", {
|
|
1117
|
+
amount,
|
|
1118
|
+
to_username: toUsername,
|
|
1119
|
+
petition_id: petitionId,
|
|
1120
|
+
note
|
|
1121
|
+
});
|
|
1110
1122
|
}
|
|
1111
1123
|
};
|
|
1112
1124
|
var CheckNamespace = class extends Namespace {
|
package/dist/index.mjs
CHANGED
|
@@ -496,9 +496,6 @@ var MeNamespace = class extends Namespace {
|
|
|
496
496
|
async badges() {
|
|
497
497
|
return this.$get("/badges");
|
|
498
498
|
}
|
|
499
|
-
async acceptTos() {
|
|
500
|
-
return this.$post("/accept_tos");
|
|
501
|
-
}
|
|
502
499
|
async abilities() {
|
|
503
500
|
return this.$get("/me/able");
|
|
504
501
|
}
|
|
@@ -517,12 +514,6 @@ var MeNamespace = class extends Namespace {
|
|
|
517
514
|
async deleteNote(username) {
|
|
518
515
|
return this.$del(`/me/note/${username}`);
|
|
519
516
|
}
|
|
520
|
-
async resendVerification() {
|
|
521
|
-
return this.$post("/me/resend_verification");
|
|
522
|
-
}
|
|
523
|
-
async verifyEmail(token) {
|
|
524
|
-
return this.$get("/verify_email", { token }, false);
|
|
525
|
-
}
|
|
526
517
|
async checkAuth() {
|
|
527
518
|
return this.$get("/check_auth");
|
|
528
519
|
}
|
|
@@ -537,10 +528,18 @@ var MeNamespace = class extends Namespace {
|
|
|
537
528
|
}));
|
|
538
529
|
}
|
|
539
530
|
async transactions() {
|
|
540
|
-
return this.$get("/me", void 0).then(
|
|
531
|
+
return this.$get("/me", void 0).then(
|
|
532
|
+
(u) => u["sys.transactions"] ?? []
|
|
533
|
+
);
|
|
541
534
|
}
|
|
542
535
|
async subscription() {
|
|
543
|
-
return this.$get("/me", void 0).then(
|
|
536
|
+
return this.$get("/me", void 0).then(
|
|
537
|
+
(u) => u["sys.subscription"] ?? {
|
|
538
|
+
active: false,
|
|
539
|
+
tier: "Free",
|
|
540
|
+
next_billing: 0
|
|
541
|
+
}
|
|
542
|
+
);
|
|
544
543
|
}
|
|
545
544
|
};
|
|
546
545
|
var PostsNamespace = class extends Namespace {
|
|
@@ -973,8 +972,12 @@ var CosmeticsNamespace = class extends Namespace {
|
|
|
973
972
|
async unequip(type) {
|
|
974
973
|
return this.$post(`/cosmetics/unequip?type=${encodeURIComponent(type)}`);
|
|
975
974
|
}
|
|
976
|
-
async overlays(
|
|
977
|
-
return this.$get(
|
|
975
|
+
async overlays(name) {
|
|
976
|
+
return this.$get(
|
|
977
|
+
`/cosmetics/overlays/${name}.gif`,
|
|
978
|
+
void 0,
|
|
979
|
+
false
|
|
980
|
+
);
|
|
978
981
|
}
|
|
979
982
|
};
|
|
980
983
|
var PushNamespace = class extends Namespace {
|
|
@@ -1072,11 +1075,20 @@ var StandingNamespace = class extends Namespace {
|
|
|
1072
1075
|
var DevFundNamespace = class extends Namespace {
|
|
1073
1076
|
/** Transfer credits to escrow for a dev fund petition */
|
|
1074
1077
|
async escrowTransfer(amount, petitionId, note) {
|
|
1075
|
-
return this.$post("/devfund/escrow_transfer", {
|
|
1078
|
+
return this.$post("/devfund/escrow_transfer", {
|
|
1079
|
+
amount,
|
|
1080
|
+
petition_id: petitionId,
|
|
1081
|
+
note
|
|
1082
|
+
});
|
|
1076
1083
|
}
|
|
1077
1084
|
/** Release escrow credits to a developer (admin only) */
|
|
1078
1085
|
async escrowRelease(amount, toUsername, petitionId, note) {
|
|
1079
|
-
return this.$post("/devfund/escrow_release", {
|
|
1086
|
+
return this.$post("/devfund/escrow_release", {
|
|
1087
|
+
amount,
|
|
1088
|
+
to_username: toUsername,
|
|
1089
|
+
petition_id: petitionId,
|
|
1090
|
+
note
|
|
1091
|
+
});
|
|
1080
1092
|
}
|
|
1081
1093
|
};
|
|
1082
1094
|
var CheckNamespace = class extends Namespace {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rotur-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "The official SDK for the Rotur platform - auth, profiles, posts, credits, keys, groups, items, gifts, tokens, validators, status, files, cosmetics, push notifications, and more",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|