@modrinth/api-client 0.35.0 → 0.36.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.ts +130 -3
- package/dist/index.js +5 -5
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export declare abstract class AbstractModrinthClient extends AbstractUploadClien
|
|
|
84
84
|
readonly launchermeta: InferredClientModules['launchermeta'];
|
|
85
85
|
readonly paper: InferredClientModules['paper'];
|
|
86
86
|
readonly purpur: InferredClientModules['purpur'];
|
|
87
|
+
readonly sharedinstances: InferredClientModules['sharedinstances'];
|
|
87
88
|
constructor(config: ClientConfig);
|
|
88
89
|
/**
|
|
89
90
|
* This creates the nested API structure (e.g., client.labrinth.projects_v2)
|
|
@@ -1881,6 +1882,11 @@ export declare interface ClientConfig {
|
|
|
1881
1882
|
* @default 'https://archon.modrinth.com'
|
|
1882
1883
|
*/
|
|
1883
1884
|
archonBaseUrl?: BaseUrlConfig;
|
|
1885
|
+
/**
|
|
1886
|
+
* Base URL for the Shared Instances API
|
|
1887
|
+
* @default 'https://shared-instances.modrinth.com'
|
|
1888
|
+
*/
|
|
1889
|
+
sharedInstancesBaseUrl?: BaseUrlConfig;
|
|
1884
1890
|
/**
|
|
1885
1891
|
* Default request timeout in milliseconds
|
|
1886
1892
|
* @default 10000
|
|
@@ -2674,7 +2680,7 @@ export declare namespace Labrinth {
|
|
|
2674
2680
|
thread_message_id: string;
|
|
2675
2681
|
} | {
|
|
2676
2682
|
context: 'report';
|
|
2677
|
-
report_id: string;
|
|
2683
|
+
report_id: string | null;
|
|
2678
2684
|
});
|
|
2679
2685
|
export type UploadedImageFor<C extends ImageUploadContext> = Extract<UploadedImage, {
|
|
2680
2686
|
context: C;
|
|
@@ -2694,7 +2700,7 @@ export declare namespace Labrinth {
|
|
|
2694
2700
|
thread_message_id: string;
|
|
2695
2701
|
} | {
|
|
2696
2702
|
context: 'report';
|
|
2697
|
-
report_id
|
|
2703
|
+
report_id?: string;
|
|
2698
2704
|
};
|
|
2699
2705
|
}
|
|
2700
2706
|
}
|
|
@@ -3902,12 +3908,13 @@ export declare namespace Labrinth {
|
|
|
3902
3908
|
}
|
|
3903
3909
|
export namespace Reports {
|
|
3904
3910
|
export namespace v3 {
|
|
3905
|
-
export type ItemType = 'project' | 'version' | 'user' | 'unknown';
|
|
3911
|
+
export type ItemType = 'project' | 'version' | 'user' | 'shared-instance' | 'unknown';
|
|
3906
3912
|
export type Report = {
|
|
3907
3913
|
id: string;
|
|
3908
3914
|
report_type: string;
|
|
3909
3915
|
item_id: string;
|
|
3910
3916
|
item_type: ItemType;
|
|
3917
|
+
shared_instance_version_id?: number;
|
|
3911
3918
|
reporter: string;
|
|
3912
3919
|
body: string;
|
|
3913
3920
|
created: string;
|
|
@@ -6417,6 +6424,10 @@ declare const MODULE_REGISTRY: {
|
|
|
6417
6424
|
readonly labrinth_versions_v3: typeof LabrinthVersionsV3Module;
|
|
6418
6425
|
readonly paper_versions_v3: typeof PaperVersionsV3Module;
|
|
6419
6426
|
readonly purpur_versions_v2: typeof PurpurVersionsV2Module;
|
|
6427
|
+
readonly sharedinstances_invites_v1: typeof SharedInstancesInvitesV1Module;
|
|
6428
|
+
readonly sharedinstances_instances_v1: typeof SharedInstancesInstancesV1Module;
|
|
6429
|
+
readonly sharedinstances_moderation_v1: typeof SharedInstancesModerationV1Module;
|
|
6430
|
+
readonly sharedinstances_users_v1: typeof SharedInstancesUsersV1Module;
|
|
6420
6431
|
};
|
|
6421
6432
|
|
|
6422
6433
|
declare type ModuleConstructor = new (client: AbstractModrinthClient) => AbstractModule;
|
|
@@ -6750,6 +6761,7 @@ export declare type RequestOptions = {
|
|
|
6750
6761
|
* API to use for this request
|
|
6751
6762
|
* - 'labrinth': Main Modrinth API (resolves to labrinthBaseUrl)
|
|
6752
6763
|
* - 'archon': Modrinth Hosting API (resolves to archonBaseUrl)
|
|
6764
|
+
* - 'sharedinstances': Shared Instances API (resolves to sharedInstancesBaseUrl)
|
|
6753
6765
|
* - string: Custom base URL (e.g., 'https://custom-api.com')
|
|
6754
6766
|
*/
|
|
6755
6767
|
api: 'labrinth' | 'archon' | string;
|
|
@@ -6928,6 +6940,121 @@ export declare class RetryFeature extends AbstractFeature {
|
|
|
6928
6940
|
*/
|
|
6929
6941
|
export declare function setNodeAuthState(getAuth: () => NodeAuth | null, refreshAuth: () => Promise<void>): void;
|
|
6930
6942
|
|
|
6943
|
+
export declare namespace SharedInstances {
|
|
6944
|
+
export namespace Invites {
|
|
6945
|
+
export namespace v1 {
|
|
6946
|
+
export type UserManager = {
|
|
6947
|
+
id: string;
|
|
6948
|
+
name: string;
|
|
6949
|
+
type: 'user';
|
|
6950
|
+
avatar?: string | null;
|
|
6951
|
+
};
|
|
6952
|
+
export type ServerManager = {
|
|
6953
|
+
name: string;
|
|
6954
|
+
type: 'server';
|
|
6955
|
+
icon?: string | null;
|
|
6956
|
+
};
|
|
6957
|
+
export type Manager = UserManager | ServerManager;
|
|
6958
|
+
export type InviteUser = {
|
|
6959
|
+
id: string;
|
|
6960
|
+
name: string;
|
|
6961
|
+
avatar?: string | null;
|
|
6962
|
+
joined_at: string | null;
|
|
6963
|
+
};
|
|
6964
|
+
export type Invite = {
|
|
6965
|
+
instance_id: string;
|
|
6966
|
+
instance_name: string;
|
|
6967
|
+
instance_icon?: string | null;
|
|
6968
|
+
game_version: string;
|
|
6969
|
+
loader_version: string;
|
|
6970
|
+
managers: Manager[];
|
|
6971
|
+
instance_users?: InviteUser[];
|
|
6972
|
+
};
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
export namespace Instances {
|
|
6976
|
+
export namespace v1 {
|
|
6977
|
+
export type Instance = {
|
|
6978
|
+
name: string;
|
|
6979
|
+
icon: string | null;
|
|
6980
|
+
quarantine: boolean;
|
|
6981
|
+
};
|
|
6982
|
+
export type JoinType = 'owner' | 'invite' | 'link';
|
|
6983
|
+
export type InstanceUser = {
|
|
6984
|
+
id: string;
|
|
6985
|
+
joined_at: string | null;
|
|
6986
|
+
join_type: JoinType;
|
|
6987
|
+
last_played: string | null;
|
|
6988
|
+
};
|
|
6989
|
+
export type InstanceUsers = {
|
|
6990
|
+
users: InstanceUser[];
|
|
6991
|
+
tokens: number;
|
|
6992
|
+
};
|
|
6993
|
+
export type FileMetadata = {
|
|
6994
|
+
path: string;
|
|
6995
|
+
hash: string;
|
|
6996
|
+
};
|
|
6997
|
+
export type ExternalFile = {
|
|
6998
|
+
file_name: string;
|
|
6999
|
+
file_type: string;
|
|
7000
|
+
url: string;
|
|
7001
|
+
file_size?: number;
|
|
7002
|
+
metadata?: FileMetadata[];
|
|
7003
|
+
};
|
|
7004
|
+
export type InstanceVersion = {
|
|
7005
|
+
version: number;
|
|
7006
|
+
modrinth_ids?: string[];
|
|
7007
|
+
ready: boolean;
|
|
7008
|
+
external_files: ExternalFile[];
|
|
7009
|
+
modpack_id: string | null;
|
|
7010
|
+
game_version: string;
|
|
7011
|
+
loader: string;
|
|
7012
|
+
loader_version: string;
|
|
7013
|
+
};
|
|
7014
|
+
}
|
|
7015
|
+
}
|
|
7016
|
+
export namespace Moderation {
|
|
7017
|
+
export namespace v1 {
|
|
7018
|
+
export type BlacklistUserRequest = {
|
|
7019
|
+
user_ids: string[];
|
|
7020
|
+
};
|
|
7021
|
+
}
|
|
7022
|
+
}
|
|
7023
|
+
export namespace Users {
|
|
7024
|
+
export namespace v1 {
|
|
7025
|
+
export type BlacklistStatus = {
|
|
7026
|
+
blacklisted: boolean;
|
|
7027
|
+
};
|
|
7028
|
+
}
|
|
7029
|
+
}
|
|
7030
|
+
}
|
|
7031
|
+
|
|
7032
|
+
declare class SharedInstancesInstancesV1Module extends AbstractModule {
|
|
7033
|
+
getModuleID(): string;
|
|
7034
|
+
get(instanceId: string): Promise<SharedInstances.Instances.v1.Instance>;
|
|
7035
|
+
getForUser(userId: string): Promise<string[]>;
|
|
7036
|
+
getUsers(instanceId: string): Promise<SharedInstances.Instances.v1.InstanceUsers>;
|
|
7037
|
+
getLatestVersion(instanceId: string): Promise<SharedInstances.Instances.v1.InstanceVersion>;
|
|
7038
|
+
getVersion(instanceId: string, version: number): Promise<SharedInstances.Instances.v1.InstanceVersion>;
|
|
7039
|
+
}
|
|
7040
|
+
|
|
7041
|
+
declare class SharedInstancesInvitesV1Module extends AbstractModule {
|
|
7042
|
+
getModuleID(): string;
|
|
7043
|
+
get(inviteId: string): Promise<SharedInstances.Invites.v1.Invite>;
|
|
7044
|
+
}
|
|
7045
|
+
|
|
7046
|
+
declare class SharedInstancesModerationV1Module extends AbstractModule {
|
|
7047
|
+
getModuleID(): string;
|
|
7048
|
+
blacklistUsers(request: SharedInstances.Moderation.v1.BlacklistUserRequest): Promise<void>;
|
|
7049
|
+
unblacklistUsers(request: SharedInstances.Moderation.v1.BlacklistUserRequest): Promise<void>;
|
|
7050
|
+
deleteFile(instanceId: string, version: number, fileName: string): Promise<void>;
|
|
7051
|
+
}
|
|
7052
|
+
|
|
7053
|
+
declare class SharedInstancesUsersV1Module extends AbstractModule {
|
|
7054
|
+
getModuleID(): string;
|
|
7055
|
+
getBlacklistStatus(userId: string): Promise<SharedInstances.Users.v1.BlacklistStatus>;
|
|
7056
|
+
}
|
|
7057
|
+
|
|
6931
7058
|
export declare class SseParser {
|
|
6932
7059
|
private buffer;
|
|
6933
7060
|
private eventName;
|