@modrinth/api-client 0.45.0 → 0.47.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 +123 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3396,6 +3396,61 @@ export declare namespace Labrinth {
|
|
|
3396
3396
|
projects: Project[];
|
|
3397
3397
|
versions: Labrinth.Versions.v3.Version[];
|
|
3398
3398
|
};
|
|
3399
|
+
export type TelemetryConsent = 'opt_in' | 'opt_out' | 'always_active';
|
|
3400
|
+
export type AiUsage = 'code' | 'assets' | 'text' | 'functionality';
|
|
3401
|
+
export type DisclosureLockStatus = 'unlocked' | 'cannot_disable' | 'fully_locked';
|
|
3402
|
+
export type DerivativeSource = {
|
|
3403
|
+
label: string;
|
|
3404
|
+
link?: string | null;
|
|
3405
|
+
note?: string | null;
|
|
3406
|
+
};
|
|
3407
|
+
export type ProjectDisclosure = {
|
|
3408
|
+
type: 'ai_content';
|
|
3409
|
+
uses: AiUsage[];
|
|
3410
|
+
note?: string | null;
|
|
3411
|
+
} | {
|
|
3412
|
+
type: 'advertisements';
|
|
3413
|
+
note?: string | null;
|
|
3414
|
+
} | {
|
|
3415
|
+
type: 'epilepsy_triggers';
|
|
3416
|
+
note?: string | null;
|
|
3417
|
+
} | {
|
|
3418
|
+
type: 'system_interactions';
|
|
3419
|
+
interactions: string[];
|
|
3420
|
+
note?: string | null;
|
|
3421
|
+
} | {
|
|
3422
|
+
type: 'telemetry';
|
|
3423
|
+
consent: TelemetryConsent;
|
|
3424
|
+
data_collected: string[];
|
|
3425
|
+
} | {
|
|
3426
|
+
type: 'derivative_work';
|
|
3427
|
+
sources: DerivativeSource[];
|
|
3428
|
+
} | {
|
|
3429
|
+
type: 'paid_features';
|
|
3430
|
+
features: string[];
|
|
3431
|
+
} | {
|
|
3432
|
+
type: 'archived';
|
|
3433
|
+
note?: string | null;
|
|
3434
|
+
};
|
|
3435
|
+
export type ProjectDisclosureData = ProjectDisclosure & {
|
|
3436
|
+
set_by_moderator: boolean;
|
|
3437
|
+
lock_status: DisclosureLockStatus;
|
|
3438
|
+
updated_at: string;
|
|
3439
|
+
updated_by?: string | null;
|
|
3440
|
+
deleted_at?: string | null;
|
|
3441
|
+
};
|
|
3442
|
+
export type ProjectDisclosureType = ProjectDisclosure['type'];
|
|
3443
|
+
export type ProjectDisclosureOf<T extends ProjectDisclosureType> = Extract<ProjectDisclosureData, {
|
|
3444
|
+
type: T;
|
|
3445
|
+
}>;
|
|
3446
|
+
export type GetProjectDisclosures = {
|
|
3447
|
+
disclosures: ProjectDisclosureData[];
|
|
3448
|
+
};
|
|
3449
|
+
export type ModifyProjectDisclosures = {
|
|
3450
|
+
set: ProjectDisclosure[];
|
|
3451
|
+
remove: ProjectDisclosureType[];
|
|
3452
|
+
lock_status?: DisclosureLockStatus | null;
|
|
3453
|
+
};
|
|
3399
3454
|
export {};
|
|
3400
3455
|
}
|
|
3401
3456
|
}
|
|
@@ -4923,6 +4978,11 @@ declare class LabrinthFriendsV3Module extends AbstractModule {
|
|
|
4923
4978
|
remove(idOrUsername: string): Promise<void>;
|
|
4924
4979
|
}
|
|
4925
4980
|
|
|
4981
|
+
declare class LabrinthGeoIpModule extends AbstractModule {
|
|
4982
|
+
getModuleID(): string;
|
|
4983
|
+
getCountry(): Promise<string | undefined>;
|
|
4984
|
+
}
|
|
4985
|
+
|
|
4926
4986
|
declare class LabrinthGlobalsInternalModule extends AbstractModule {
|
|
4927
4987
|
getModuleID(): string;
|
|
4928
4988
|
/**
|
|
@@ -5553,6 +5613,68 @@ declare class LabrinthProjectsV3Module extends AbstractModule {
|
|
|
5553
5613
|
* ```
|
|
5554
5614
|
*/
|
|
5555
5615
|
deleteIcon(id: string): Promise<void>;
|
|
5616
|
+
/**
|
|
5617
|
+
* Create a gallery image for a project
|
|
5618
|
+
*
|
|
5619
|
+
* @param id - Project ID or slug
|
|
5620
|
+
* @param file - Image file to upload
|
|
5621
|
+
* @param options - Gallery image options
|
|
5622
|
+
*
|
|
5623
|
+
* @example
|
|
5624
|
+
* ```typescript
|
|
5625
|
+
* await client.labrinth.projects_v3.createGalleryImage('sodium', imageFile, {
|
|
5626
|
+
* featured: true,
|
|
5627
|
+
* name: 'Screenshot 1',
|
|
5628
|
+
* description: 'Main menu with Sodium enabled'
|
|
5629
|
+
* })
|
|
5630
|
+
* ```
|
|
5631
|
+
*/
|
|
5632
|
+
createGalleryImage(id: string, file: Blob, options: {
|
|
5633
|
+
ext: string;
|
|
5634
|
+
featured: boolean;
|
|
5635
|
+
name?: string;
|
|
5636
|
+
description?: string;
|
|
5637
|
+
ordering?: number;
|
|
5638
|
+
}): Promise<void>;
|
|
5639
|
+
/**
|
|
5640
|
+
* Delete a gallery image from a project
|
|
5641
|
+
*
|
|
5642
|
+
* @param id - Project ID or slug
|
|
5643
|
+
* @param url - URL of the gallery image to delete
|
|
5644
|
+
*
|
|
5645
|
+
* @example
|
|
5646
|
+
* ```typescript
|
|
5647
|
+
* await client.labrinth.projects_v3.deleteGalleryImage('sodium', 'https://cdn.modrinth.com/...')
|
|
5648
|
+
* ```
|
|
5649
|
+
*/
|
|
5650
|
+
deleteGalleryImage(id: string, url: string): Promise<void>;
|
|
5651
|
+
/**
|
|
5652
|
+
* Get content disclosures for a project
|
|
5653
|
+
*
|
|
5654
|
+
* @param id - Project ID or slug
|
|
5655
|
+
* @returns Promise resolving to the project's disclosures
|
|
5656
|
+
*
|
|
5657
|
+
* @example
|
|
5658
|
+
* ```typescript
|
|
5659
|
+
* const { disclosures } = await client.labrinth.projects_v3.getDisclosures('sodium')
|
|
5660
|
+
* ```
|
|
5661
|
+
*/
|
|
5662
|
+
getDisclosures(id: string): Promise<Labrinth.Projects.v3.GetProjectDisclosures>;
|
|
5663
|
+
/**
|
|
5664
|
+
* Modify content disclosures for a project
|
|
5665
|
+
*
|
|
5666
|
+
* @param id - Project ID or slug
|
|
5667
|
+
* @param data - Disclosures to set and types to remove
|
|
5668
|
+
*
|
|
5669
|
+
* @example
|
|
5670
|
+
* ```typescript
|
|
5671
|
+
* await client.labrinth.projects_v3.modifyDisclosures('sodium', {
|
|
5672
|
+
* set: [{ type: 'ai_content', uses: ['text'], note: 'Translations are AI-generated.' }],
|
|
5673
|
+
* remove: ['advertisements'],
|
|
5674
|
+
* })
|
|
5675
|
+
* ```
|
|
5676
|
+
*/
|
|
5677
|
+
modifyDisclosures(id: string, data: Labrinth.Projects.v3.ModifyProjectDisclosures): Promise<void>;
|
|
5556
5678
|
}
|
|
5557
5679
|
|
|
5558
5680
|
declare class LabrinthReportsV3Module extends AbstractModule {
|
|
@@ -6471,6 +6593,7 @@ declare const MODULE_REGISTRY: {
|
|
|
6471
6593
|
readonly labrinth_content_v3: typeof LabrinthContentV3Module;
|
|
6472
6594
|
readonly labrinth_external_projects_internal: typeof LabrinthExternalProjectsInternalModule;
|
|
6473
6595
|
readonly labrinth_friends_v3: typeof LabrinthFriendsV3Module;
|
|
6596
|
+
readonly labrinth_geoip: typeof LabrinthGeoIpModule;
|
|
6474
6597
|
readonly labrinth_globals_internal: typeof LabrinthGlobalsInternalModule;
|
|
6475
6598
|
readonly labrinth_images_v3: typeof LabrinthImagesV3Module;
|
|
6476
6599
|
readonly labrinth_moderation_internal: typeof LabrinthModerationInternalModule;
|