@modrinth/api-client 0.31.0 → 0.33.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 +7104 -28
- package/dist/index.js +2 -1
- package/dist/index.js.map +7 -0
- package/package.json +4 -2
- package/dist/core/abstract-client.d.ts +0 -163
- package/dist/core/abstract-feature.d.ts +0 -72
- package/dist/core/abstract-module.d.ts +0 -10
- package/dist/core/abstract-sync.d.ts +0 -61
- package/dist/core/abstract-upload-client.d.ts +0 -20
- package/dist/core/abstract-websocket.d.ts +0 -52
- package/dist/core/errors.d.ts +0 -48
- package/dist/features/auth.d.ts +0 -47
- package/dist/features/circuit-breaker.d.ts +0 -139
- package/dist/features/node-auth.d.ts +0 -58
- package/dist/features/panel-version.d.ts +0 -7
- package/dist/features/retry.d.ts +0 -87
- package/dist/features/verbose-logging.d.ts +0 -6
- package/dist/modules/archon/actions/v1.d.ts +0 -10
- package/dist/modules/archon/backups/v1.d.ts +0 -44
- package/dist/modules/archon/backups-queue/v1.d.ts +0 -25
- package/dist/modules/archon/content/v1.d.ts +0 -48
- package/dist/modules/archon/index.d.ts +0 -8
- package/dist/modules/archon/nodes/internal.d.ts +0 -10
- package/dist/modules/archon/notices/v0.d.ts +0 -38
- package/dist/modules/archon/options/v1.d.ts +0 -9
- package/dist/modules/archon/properties/v1.d.ts +0 -9
- package/dist/modules/archon/server-users/v1.d.ts +0 -30
- package/dist/modules/archon/servers/v0.d.ts +0 -122
- package/dist/modules/archon/servers/v1.d.ts +0 -30
- package/dist/modules/archon/transfers/internal.d.ts +0 -25
- package/dist/modules/archon/types.d.ts +0 -941
- package/dist/modules/index.d.ts +0 -181
- package/dist/modules/iso3166/index.d.ts +0 -24
- package/dist/modules/iso3166/types.d.ts +0 -21
- package/dist/modules/kyros/content/v1.d.ts +0 -23
- package/dist/modules/kyros/files/v0.d.ts +0 -123
- package/dist/modules/kyros/logs/v1.d.ts +0 -6
- package/dist/modules/kyros/types.d.ts +0 -44
- package/dist/modules/kyros/upload-sessions/v1.d.ts +0 -18
- package/dist/modules/labrinth/affiliate/internal.d.ts +0 -30
- package/dist/modules/labrinth/analytics/v3.d.ts +0 -56
- package/dist/modules/labrinth/attribution/internal.d.ts +0 -47
- package/dist/modules/labrinth/auth/internal.d.ts +0 -19
- package/dist/modules/labrinth/auth/v2.d.ts +0 -98
- package/dist/modules/labrinth/billing/internal.d.ts +0 -65
- package/dist/modules/labrinth/campaign/internal.d.ts +0 -10
- package/dist/modules/labrinth/collections.d.ts +0 -80
- package/dist/modules/labrinth/content/v3.d.ts +0 -6
- package/dist/modules/labrinth/external-projects/internal.d.ts +0 -9
- package/dist/modules/labrinth/friends/v3.d.ts +0 -23
- package/dist/modules/labrinth/globals/internal.d.ts +0 -11
- package/dist/modules/labrinth/images/v3.d.ts +0 -7
- package/dist/modules/labrinth/index.d.ts +0 -31
- package/dist/modules/labrinth/limits/v3.d.ts +0 -17
- package/dist/modules/labrinth/moderation/internal.d.ts +0 -12
- package/dist/modules/labrinth/notifications/v2.d.ts +0 -73
- package/dist/modules/labrinth/oauth/internal.d.ts +0 -97
- package/dist/modules/labrinth/organizations/v3.d.ts +0 -66
- package/dist/modules/labrinth/pats/v2.d.ts +0 -31
- package/dist/modules/labrinth/payout/v3.d.ts +0 -30
- package/dist/modules/labrinth/payouts/v3.d.ts +0 -15
- package/dist/modules/labrinth/projects/v2.d.ts +0 -169
- package/dist/modules/labrinth/projects/v3.d.ts +0 -110
- package/dist/modules/labrinth/reports/v3.d.ts +0 -81
- package/dist/modules/labrinth/server-ping/internal.d.ts +0 -10
- package/dist/modules/labrinth/sessions/v2.d.ts +0 -17
- package/dist/modules/labrinth/state/index.d.ts +0 -17
- package/dist/modules/labrinth/tags/v2.d.ts +0 -19
- package/dist/modules/labrinth/teams/v2.d.ts +0 -57
- package/dist/modules/labrinth/teams/v3.d.ts +0 -18
- package/dist/modules/labrinth/tech-review/internal.d.ts +0 -77
- package/dist/modules/labrinth/threads/v3.d.ts +0 -57
- package/dist/modules/labrinth/types.d.ts +0 -2119
- package/dist/modules/labrinth/users/v2.d.ts +0 -101
- package/dist/modules/labrinth/users/v3.d.ts +0 -37
- package/dist/modules/labrinth/versions/v2.d.ts +0 -75
- package/dist/modules/labrinth/versions/v3.d.ts +0 -123
- package/dist/modules/launcher-meta/types.d.ts +0 -25
- package/dist/modules/launcher-meta/v0.d.ts +0 -17
- package/dist/modules/mclogs/insights/v1.d.ts +0 -6
- package/dist/modules/mclogs/logs/v1.d.ts +0 -6
- package/dist/modules/mclogs/types.d.ts +0 -60
- package/dist/modules/paper/types.d.ts +0 -22
- package/dist/modules/paper/v3.d.ts +0 -19
- package/dist/modules/purpur/types.d.ts +0 -15
- package/dist/modules/purpur/v2.d.ts +0 -16
- package/dist/modules/types.d.ts +0 -8
- package/dist/platform/generic.d.ts +0 -28
- package/dist/platform/nuxt.d.ts +0 -88
- package/dist/platform/sync-generic.d.ts +0 -16
- package/dist/platform/tauri.d.ts +0 -35
- package/dist/platform/websocket-generic.d.ts +0 -16
- package/dist/platform/xhr-upload-client.d.ts +0 -15
- package/dist/state/node-auth.d.ts +0 -36
- package/dist/types/client.d.ts +0 -70
- package/dist/types/errors.d.ts +0 -43
- package/dist/types/index.d.ts +0 -10
- package/dist/types/request.d.ts +0 -124
- package/dist/types/upload.d.ts +0 -92
- package/dist/utils/fetch.d.ts +0 -4
- package/dist/utils/jwt-retry.d.ts +0 -5
- package/dist/utils/node-url.d.ts +0 -2
- package/dist/utils/pingtest.d.ts +0 -8
- package/dist/utils/sse.d.ts +0 -24
- package/dist/utils/types.d.ts +0 -2
package/dist/modules/index.d.ts
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import type { AbstractModrinthClient } from '../core/abstract-client';
|
|
2
|
-
import type { AbstractModule } from '../core/abstract-module';
|
|
3
|
-
import { ArchonActionsV1Module } from './archon/actions/v1';
|
|
4
|
-
import { ArchonBackupsV1Module } from './archon/backups/v1';
|
|
5
|
-
import { ArchonBackupsQueueV1Module } from './archon/backups-queue/v1';
|
|
6
|
-
import { ArchonContentV1Module } from './archon/content/v1';
|
|
7
|
-
import { ArchonNodesInternalModule } from './archon/nodes/internal';
|
|
8
|
-
import { ArchonNoticesV0Module } from './archon/notices/v0';
|
|
9
|
-
import { ArchonOptionsV1Module } from './archon/options/v1';
|
|
10
|
-
import { ArchonPropertiesV1Module } from './archon/properties/v1';
|
|
11
|
-
import { ArchonServerUsersV1Module } from './archon/server-users/v1';
|
|
12
|
-
import { ArchonServersV0Module } from './archon/servers/v0';
|
|
13
|
-
import { ArchonServersV1Module } from './archon/servers/v1';
|
|
14
|
-
import { ArchonTransfersInternalModule } from './archon/transfers/internal';
|
|
15
|
-
import { ISO3166Module } from './iso3166';
|
|
16
|
-
import { KyrosContentV1Module } from './kyros/content/v1';
|
|
17
|
-
import { KyrosFilesV0Module } from './kyros/files/v0';
|
|
18
|
-
import { KyrosLogsV1Module } from './kyros/logs/v1';
|
|
19
|
-
import { KyrosUploadSessionsV1Module } from './kyros/upload-sessions/v1';
|
|
20
|
-
import { LabrinthVersionsV2Module, LabrinthVersionsV3Module } from './labrinth';
|
|
21
|
-
import { LabrinthAffiliateInternalModule } from './labrinth/affiliate/internal';
|
|
22
|
-
import { LabrinthAnalyticsV3Module } from './labrinth/analytics/v3';
|
|
23
|
-
import { LabrinthAttributionInternalModule } from './labrinth/attribution/internal';
|
|
24
|
-
import { LabrinthAuthInternalModule } from './labrinth/auth/internal';
|
|
25
|
-
import { LabrinthAuthV2Module } from './labrinth/auth/v2';
|
|
26
|
-
import { LabrinthBillingInternalModule } from './labrinth/billing/internal';
|
|
27
|
-
import { LabrinthCampaignInternalModule } from './labrinth/campaign/internal';
|
|
28
|
-
import { LabrinthCollectionsModule } from './labrinth/collections';
|
|
29
|
-
import { LabrinthContentV3Module } from './labrinth/content/v3';
|
|
30
|
-
import { LabrinthExternalProjectsInternalModule } from './labrinth/external-projects/internal';
|
|
31
|
-
import { LabrinthFriendsV3Module } from './labrinth/friends/v3';
|
|
32
|
-
import { LabrinthGlobalsInternalModule } from './labrinth/globals/internal';
|
|
33
|
-
import { LabrinthImagesV3Module } from './labrinth/images/v3';
|
|
34
|
-
import { LabrinthLimitsV3Module } from './labrinth/limits/v3';
|
|
35
|
-
import { LabrinthModerationInternalModule } from './labrinth/moderation/internal';
|
|
36
|
-
import { LabrinthNotificationsV2Module } from './labrinth/notifications/v2';
|
|
37
|
-
import { LabrinthOAuthInternalModule } from './labrinth/oauth/internal';
|
|
38
|
-
import { LabrinthOrganizationsV3Module } from './labrinth/organizations/v3';
|
|
39
|
-
import { LabrinthPatsV2Module } from './labrinth/pats/v2';
|
|
40
|
-
import { LabrinthPayoutV3Module } from './labrinth/payout/v3';
|
|
41
|
-
import { LabrinthPayoutsV3Module } from './labrinth/payouts/v3';
|
|
42
|
-
import { LabrinthProjectsV2Module } from './labrinth/projects/v2';
|
|
43
|
-
import { LabrinthProjectsV3Module } from './labrinth/projects/v3';
|
|
44
|
-
import { LabrinthReportsV3Module } from './labrinth/reports/v3';
|
|
45
|
-
import { LabrinthServerPingInternalModule } from './labrinth/server-ping/internal';
|
|
46
|
-
import { LabrinthSessionsV2Module } from './labrinth/sessions/v2';
|
|
47
|
-
import { LabrinthStateModule } from './labrinth/state';
|
|
48
|
-
import { LabrinthTagsV2Module } from './labrinth/tags/v2';
|
|
49
|
-
import { LabrinthTeamsV2Module } from './labrinth/teams/v2';
|
|
50
|
-
import { LabrinthTeamsV3Module } from './labrinth/teams/v3';
|
|
51
|
-
import { LabrinthTechReviewInternalModule } from './labrinth/tech-review/internal';
|
|
52
|
-
import { LabrinthThreadsV3Module } from './labrinth/threads/v3';
|
|
53
|
-
import { LabrinthUsersV2Module } from './labrinth/users/v2';
|
|
54
|
-
import { LabrinthUsersV3Module } from './labrinth/users/v3';
|
|
55
|
-
import { LauncherMetaManifestV0Module } from './launcher-meta/v0';
|
|
56
|
-
import { MclogsInsightsV1Module } from './mclogs/insights/v1';
|
|
57
|
-
import { MclogsLogsV1Module } from './mclogs/logs/v1';
|
|
58
|
-
import { PaperVersionsV3Module } from './paper/v3';
|
|
59
|
-
import { PurpurVersionsV2Module } from './purpur/v2';
|
|
60
|
-
type ModuleConstructor = new (client: AbstractModrinthClient) => AbstractModule;
|
|
61
|
-
/**
|
|
62
|
-
* To add a new module:
|
|
63
|
-
* 1. Create your module class extending AbstractModule
|
|
64
|
-
* 2. Add one line here: `<api>_<module>: YourModuleClass`
|
|
65
|
-
*
|
|
66
|
-
* TypeScript will automatically infer the client's field structure from this registry.
|
|
67
|
-
*
|
|
68
|
-
* TODO: Better way? Probably not
|
|
69
|
-
*/
|
|
70
|
-
export declare const MODULE_REGISTRY: {
|
|
71
|
-
readonly archon_actions_v1: typeof ArchonActionsV1Module;
|
|
72
|
-
readonly archon_backups_queue_v1: typeof ArchonBackupsQueueV1Module;
|
|
73
|
-
readonly archon_backups_v1: typeof ArchonBackupsV1Module;
|
|
74
|
-
readonly archon_content_v1: typeof ArchonContentV1Module;
|
|
75
|
-
readonly archon_nodes_internal: typeof ArchonNodesInternalModule;
|
|
76
|
-
readonly archon_notices_v0: typeof ArchonNoticesV0Module;
|
|
77
|
-
readonly archon_options_v1: typeof ArchonOptionsV1Module;
|
|
78
|
-
readonly archon_properties_v1: typeof ArchonPropertiesV1Module;
|
|
79
|
-
readonly archon_server_users_v1: typeof ArchonServerUsersV1Module;
|
|
80
|
-
readonly archon_servers_v0: typeof ArchonServersV0Module;
|
|
81
|
-
readonly archon_servers_v1: typeof ArchonServersV1Module;
|
|
82
|
-
readonly archon_transfers_internal: typeof ArchonTransfersInternalModule;
|
|
83
|
-
readonly iso3166_data: typeof ISO3166Module;
|
|
84
|
-
readonly mclogs_insights_v1: typeof MclogsInsightsV1Module;
|
|
85
|
-
readonly mclogs_logs_v1: typeof MclogsLogsV1Module;
|
|
86
|
-
readonly launchermeta_manifest_v0: typeof LauncherMetaManifestV0Module;
|
|
87
|
-
readonly kyros_content_v1: typeof KyrosContentV1Module;
|
|
88
|
-
readonly kyros_files_v0: typeof KyrosFilesV0Module;
|
|
89
|
-
readonly kyros_logs_v1: typeof KyrosLogsV1Module;
|
|
90
|
-
readonly kyros_upload_sessions_v1: typeof KyrosUploadSessionsV1Module;
|
|
91
|
-
readonly labrinth_affiliate_internal: typeof LabrinthAffiliateInternalModule;
|
|
92
|
-
readonly labrinth_analytics_v3: typeof LabrinthAnalyticsV3Module;
|
|
93
|
-
readonly labrinth_auth_internal: typeof LabrinthAuthInternalModule;
|
|
94
|
-
readonly labrinth_auth_v2: typeof LabrinthAuthV2Module;
|
|
95
|
-
readonly labrinth_attribution_internal: typeof LabrinthAttributionInternalModule;
|
|
96
|
-
readonly labrinth_billing_internal: typeof LabrinthBillingInternalModule;
|
|
97
|
-
readonly labrinth_campaign_internal: typeof LabrinthCampaignInternalModule;
|
|
98
|
-
readonly labrinth_collections: typeof LabrinthCollectionsModule;
|
|
99
|
-
readonly labrinth_content_v3: typeof LabrinthContentV3Module;
|
|
100
|
-
readonly labrinth_external_projects_internal: typeof LabrinthExternalProjectsInternalModule;
|
|
101
|
-
readonly labrinth_friends_v3: typeof LabrinthFriendsV3Module;
|
|
102
|
-
readonly labrinth_globals_internal: typeof LabrinthGlobalsInternalModule;
|
|
103
|
-
readonly labrinth_images_v3: typeof LabrinthImagesV3Module;
|
|
104
|
-
readonly labrinth_moderation_internal: typeof LabrinthModerationInternalModule;
|
|
105
|
-
readonly labrinth_notifications_v2: typeof LabrinthNotificationsV2Module;
|
|
106
|
-
readonly labrinth_oauth_internal: typeof LabrinthOAuthInternalModule;
|
|
107
|
-
readonly labrinth_organizations_v3: typeof LabrinthOrganizationsV3Module;
|
|
108
|
-
readonly labrinth_pats_v2: typeof LabrinthPatsV2Module;
|
|
109
|
-
readonly labrinth_limits_v3: typeof LabrinthLimitsV3Module;
|
|
110
|
-
readonly labrinth_payout_v3: typeof LabrinthPayoutV3Module;
|
|
111
|
-
readonly labrinth_payouts_v3: typeof LabrinthPayoutsV3Module;
|
|
112
|
-
readonly labrinth_projects_v2: typeof LabrinthProjectsV2Module;
|
|
113
|
-
readonly labrinth_projects_v3: typeof LabrinthProjectsV3Module;
|
|
114
|
-
readonly labrinth_reports_v3: typeof LabrinthReportsV3Module;
|
|
115
|
-
readonly labrinth_server_ping_internal: typeof LabrinthServerPingInternalModule;
|
|
116
|
-
readonly labrinth_sessions_v2: typeof LabrinthSessionsV2Module;
|
|
117
|
-
readonly labrinth_state: typeof LabrinthStateModule;
|
|
118
|
-
readonly labrinth_tags_v2: typeof LabrinthTagsV2Module;
|
|
119
|
-
readonly labrinth_teams_v2: typeof LabrinthTeamsV2Module;
|
|
120
|
-
readonly labrinth_teams_v3: typeof LabrinthTeamsV3Module;
|
|
121
|
-
readonly labrinth_tech_review_internal: typeof LabrinthTechReviewInternalModule;
|
|
122
|
-
readonly labrinth_threads_v3: typeof LabrinthThreadsV3Module;
|
|
123
|
-
readonly labrinth_users_v2: typeof LabrinthUsersV2Module;
|
|
124
|
-
readonly labrinth_users_v3: typeof LabrinthUsersV3Module;
|
|
125
|
-
readonly labrinth_versions_v2: typeof LabrinthVersionsV2Module;
|
|
126
|
-
readonly labrinth_versions_v3: typeof LabrinthVersionsV3Module;
|
|
127
|
-
readonly paper_versions_v3: typeof PaperVersionsV3Module;
|
|
128
|
-
readonly purpur_versions_v2: typeof PurpurVersionsV2Module;
|
|
129
|
-
};
|
|
130
|
-
export type ModuleID = keyof typeof MODULE_REGISTRY;
|
|
131
|
-
/**
|
|
132
|
-
* Parse a module ID into [api, moduleName] tuple
|
|
133
|
-
*
|
|
134
|
-
* @param id - Module ID in format `<api>_<module>` (e.g., 'labrinth_projects_v2')
|
|
135
|
-
* @returns Tuple of [api, moduleName] (e.g., ['labrinth', 'projects_v2'])
|
|
136
|
-
* @throws Error if module ID doesn't match expected format
|
|
137
|
-
*/
|
|
138
|
-
export declare function parseModuleID(id: string): [string, string];
|
|
139
|
-
/**
|
|
140
|
-
* Build nested module structure from flat registry
|
|
141
|
-
*
|
|
142
|
-
* Transforms:
|
|
143
|
-
* ```
|
|
144
|
-
* { labrinth_projects_v2: Constructor, labrinth_users_v2: Constructor }
|
|
145
|
-
* ```
|
|
146
|
-
* Into:
|
|
147
|
-
* ```
|
|
148
|
-
* { labrinth: { projects_v2: Constructor, users_v2: Constructor } }
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* @returns Nested structure organized by API namespace
|
|
152
|
-
*/
|
|
153
|
-
export declare function buildModuleStructure(): Record<string, Record<string, ModuleConstructor>>;
|
|
154
|
-
/**
|
|
155
|
-
* Extract API name from module ID
|
|
156
|
-
* @example ParseAPI<'labrinth_projects_v2'> = 'labrinth'
|
|
157
|
-
*/
|
|
158
|
-
type ParseAPI<T extends string> = T extends `${infer API}_${string}` ? API : never;
|
|
159
|
-
/**
|
|
160
|
-
* Extract module name for a given API
|
|
161
|
-
* @example ParseModule<'labrinth_projects_v2', 'labrinth'> = 'projects_v2'
|
|
162
|
-
*/
|
|
163
|
-
type ParseModule<T extends string, API extends string> = T extends `${API}_${infer Module}` ? Module : never;
|
|
164
|
-
/**
|
|
165
|
-
* Group registry modules by API namespace
|
|
166
|
-
*
|
|
167
|
-
* Transforms flat registry into nested structure at the type level:
|
|
168
|
-
* ```
|
|
169
|
-
* { labrinth_projects_v2: ModuleClass } → { labrinth: { projects_v2: ModuleInstance } }
|
|
170
|
-
* ```
|
|
171
|
-
*/
|
|
172
|
-
type GroupByAPI<Registry extends Record<string, ModuleConstructor>> = {
|
|
173
|
-
[API in ParseAPI<keyof Registry & string>]: {
|
|
174
|
-
[Module in ParseModule<keyof Registry & string, API>]: InstanceType<Registry[`${API}_${Module}`]>;
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* Inferred client module structure
|
|
179
|
-
**/
|
|
180
|
-
export type InferredClientModules = GroupByAPI<typeof MODULE_REGISTRY>;
|
|
181
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AbstractModule } from '../../core/abstract-module';
|
|
2
|
-
import type { ISO3166 } from './types';
|
|
3
|
-
export type { ISO3166 } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Module for fetching ISO 3166 country and subdivision data
|
|
6
|
-
* Data from https://github.com/ipregistry/iso3166 (Licensed under CC BY-SA 4.0)
|
|
7
|
-
* @platform Not for use in Tauri or Nuxt environments, only node.
|
|
8
|
-
*/
|
|
9
|
-
export declare class ISO3166Module extends AbstractModule {
|
|
10
|
-
getModuleID(): string;
|
|
11
|
-
/**
|
|
12
|
-
* Build ISO 3166 country and subdivision data from the ipregistry repository
|
|
13
|
-
*
|
|
14
|
-
* @returns Promise resolving to countries and subdivisions data
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const data = await client.iso3166.data.build()
|
|
19
|
-
* console.log(data.countries) // Array of country data
|
|
20
|
-
* console.log(data.subdivisions['US']) // Array of US state data
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
build(): Promise<ISO3166.State>;
|
|
24
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare namespace ISO3166 {
|
|
2
|
-
interface Country {
|
|
3
|
-
alpha2: string;
|
|
4
|
-
alpha3: string;
|
|
5
|
-
numeric: string;
|
|
6
|
-
nameShort: string;
|
|
7
|
-
nameLong: string;
|
|
8
|
-
}
|
|
9
|
-
interface Subdivision {
|
|
10
|
-
code: string;
|
|
11
|
-
name: string;
|
|
12
|
-
localVariant: string | null;
|
|
13
|
-
category: string;
|
|
14
|
-
parent: string | null;
|
|
15
|
-
language: string;
|
|
16
|
-
}
|
|
17
|
-
interface State {
|
|
18
|
-
countries: Country[];
|
|
19
|
-
subdivisions: Record<string, Subdivision[]>;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AbstractModule } from '../../../core/abstract-module';
|
|
2
|
-
import type { UploadHandle, UploadProgress } from '../../../types/upload';
|
|
3
|
-
import type { Archon } from '../../archon/types';
|
|
4
|
-
export declare class KyrosContentV1Module extends AbstractModule {
|
|
5
|
-
getModuleID(): string;
|
|
6
|
-
/**
|
|
7
|
-
* Upload addon files to a world via multipart form data
|
|
8
|
-
*
|
|
9
|
-
* @param worldId - World UUID
|
|
10
|
-
* @param files - Files to upload as addons
|
|
11
|
-
* @param options - Optional progress callback
|
|
12
|
-
* @returns UploadHandle with promise, onProgress, and cancel
|
|
13
|
-
* @deprecated Use `kyros.upload_sessions_v1` so cancellation can remove staged addon files before finalize.
|
|
14
|
-
*/
|
|
15
|
-
uploadAddonFile(worldId: string, files: (File | Blob)[], options?: {
|
|
16
|
-
onProgress?: (progress: UploadProgress) => void;
|
|
17
|
-
}): UploadHandle<void>;
|
|
18
|
-
/** POST /v1/worlds/:world_id/content/upload-modpack-file */
|
|
19
|
-
uploadModpackFile(worldId: string, file: File | Blob, properties: Archon.Content.v1.PropertiesFields, options?: {
|
|
20
|
-
softOverride?: boolean;
|
|
21
|
-
onProgress?: (progress: UploadProgress) => void;
|
|
22
|
-
}): UploadHandle<void>;
|
|
23
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { AbstractModule } from '../../../core/abstract-module';
|
|
2
|
-
import type { UploadHandle, UploadProgress } from '../../../types/upload';
|
|
3
|
-
import type { Archon } from '../../archon/types';
|
|
4
|
-
import type { Kyros } from '../types';
|
|
5
|
-
type NodeFsAuth = Pick<Archon.Servers.v0.JWTAuth, 'url' | 'token'>;
|
|
6
|
-
export declare class KyrosFilesV0Module extends AbstractModule {
|
|
7
|
-
getModuleID(): string;
|
|
8
|
-
private getNodeBaseUrl;
|
|
9
|
-
/**
|
|
10
|
-
* List directory contents with pagination
|
|
11
|
-
*
|
|
12
|
-
* @param path - Directory path (e.g., "/")
|
|
13
|
-
* @param page - Page number (1-indexed)
|
|
14
|
-
* @param pageSize - Items per page
|
|
15
|
-
* @returns Directory listing with items and pagination info
|
|
16
|
-
*/
|
|
17
|
-
listDirectory(path: string, page?: number, pageSize?: number): Promise<Kyros.Files.v0.DirectoryResponse>;
|
|
18
|
-
/**
|
|
19
|
-
* Create a file or directory
|
|
20
|
-
*
|
|
21
|
-
* @param path - Path for new item (e.g., "/new-folder")
|
|
22
|
-
* @param type - Type of item to create
|
|
23
|
-
*/
|
|
24
|
-
createFileOrFolder(path: string, type: 'file' | 'directory'): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Download a file from a server's filesystem
|
|
27
|
-
*
|
|
28
|
-
* @param path - File path (e.g., "/server-icon-original.png")
|
|
29
|
-
* @returns Promise resolving to file Blob
|
|
30
|
-
*/
|
|
31
|
-
downloadFile(path: string): Promise<Blob>;
|
|
32
|
-
/**
|
|
33
|
-
* Download a file using explicit filesystem auth credentials.
|
|
34
|
-
*
|
|
35
|
-
* @param auth - Filesystem auth (url + token) from Archon
|
|
36
|
-
* @param path - File path (e.g., "/server-icon.png")
|
|
37
|
-
* @returns Promise resolving to file Blob
|
|
38
|
-
*/
|
|
39
|
-
downloadFileWithAuth(auth: NodeFsAuth, path: string): Promise<Blob>;
|
|
40
|
-
/**
|
|
41
|
-
* Upload a file to a server's filesystem with progress tracking
|
|
42
|
-
*
|
|
43
|
-
* @param path - Destination path (e.g., "/server-icon.png")
|
|
44
|
-
* @param file - File to upload
|
|
45
|
-
* @param options - Optional progress callback and feature overrides
|
|
46
|
-
* @returns UploadHandle with promise, onProgress, and cancel
|
|
47
|
-
* @deprecated Use `kyros.upload_sessions_v1` for bulk uploads so cancellation can remove staged files before finalize.
|
|
48
|
-
*/
|
|
49
|
-
uploadFile(path: string, file: File | Blob, options?: {
|
|
50
|
-
onProgress?: (progress: UploadProgress) => void;
|
|
51
|
-
retry?: boolean | number;
|
|
52
|
-
}): UploadHandle<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Upload a file using explicit filesystem auth credentials.
|
|
55
|
-
*
|
|
56
|
-
* @param auth - Filesystem auth (url + token) from Archon
|
|
57
|
-
* @param path - Destination path (e.g., "/server-icon.png")
|
|
58
|
-
* @param file - File to upload
|
|
59
|
-
* @param options - Optional progress callback and feature overrides
|
|
60
|
-
* @returns UploadHandle with promise, onProgress, and cancel
|
|
61
|
-
*/
|
|
62
|
-
uploadFileWithAuth(auth: NodeFsAuth, path: string, file: File | Blob, options?: {
|
|
63
|
-
onProgress?: (progress: UploadProgress) => void;
|
|
64
|
-
retry?: boolean | number;
|
|
65
|
-
}): UploadHandle<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Update file contents
|
|
68
|
-
*
|
|
69
|
-
* @param path - File path to update
|
|
70
|
-
* @param content - New file content (string or Blob)
|
|
71
|
-
*/
|
|
72
|
-
updateFile(path: string, content: string | Blob): Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* Move a file or folder to a new location
|
|
75
|
-
*
|
|
76
|
-
* @param sourcePath - Current path
|
|
77
|
-
* @param destPath - New path
|
|
78
|
-
*/
|
|
79
|
-
moveFileOrFolder(sourcePath: string, destPath: string): Promise<void>;
|
|
80
|
-
/**
|
|
81
|
-
* Rename a file or folder (convenience wrapper around move)
|
|
82
|
-
*
|
|
83
|
-
* @param path - Current file/folder path
|
|
84
|
-
* @param newName - New name (not full path)
|
|
85
|
-
*/
|
|
86
|
-
renameFileOrFolder(path: string, newName: string): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* Delete a file or folder
|
|
89
|
-
*
|
|
90
|
-
* @param path - Path to delete
|
|
91
|
-
* @param recursive - If true, delete directory contents recursively
|
|
92
|
-
*/
|
|
93
|
-
deleteFileOrFolder(path: string, recursive: boolean): Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* Delete a file or folder using explicit filesystem auth credentials.
|
|
96
|
-
*
|
|
97
|
-
* @param auth - Filesystem auth (url + token) from Archon
|
|
98
|
-
* @param path - Path to delete
|
|
99
|
-
* @param recursive - If true, delete directory contents recursively
|
|
100
|
-
*/
|
|
101
|
-
deleteFileOrFolderWithAuth(auth: NodeFsAuth, path: string, recursive: boolean): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Extract an archive file (zip, tar, etc.)
|
|
104
|
-
*
|
|
105
|
-
* Uses v1 API endpoint.
|
|
106
|
-
*
|
|
107
|
-
* @param path - Path to archive file
|
|
108
|
-
* @param override - If true, overwrite existing files
|
|
109
|
-
* @param dry - If true, perform dry run (returns conflicts without extracting)
|
|
110
|
-
* @returns Extract result with modpack name and conflicting files
|
|
111
|
-
*/
|
|
112
|
-
extractFile(path: string, override?: boolean, dry?: boolean): Promise<Kyros.Files.v0.ExtractResult>;
|
|
113
|
-
/**
|
|
114
|
-
* Modify a filesystem operation (dismiss or cancel)
|
|
115
|
-
*
|
|
116
|
-
* Uses v1 API endpoint.
|
|
117
|
-
*
|
|
118
|
-
* @param opId - Operation ID (UUID)
|
|
119
|
-
* @param action - Action to perform
|
|
120
|
-
*/
|
|
121
|
-
modifyOperation(opId: string, action: 'dismiss' | 'cancel'): Promise<void>;
|
|
122
|
-
}
|
|
123
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export declare namespace Kyros {
|
|
2
|
-
namespace UploadSessions {
|
|
3
|
-
namespace v1 {
|
|
4
|
-
type Scope = 'content' | 'files';
|
|
5
|
-
type UploadSessionStatus = 'active' | 'uploading' | 'finalizing' | 'cancelled' | 'finalized' | 'expired';
|
|
6
|
-
interface UploadSessionResponse {
|
|
7
|
-
upload_id: string;
|
|
8
|
-
status: UploadSessionStatus;
|
|
9
|
-
created_at: number;
|
|
10
|
-
updated_at: number;
|
|
11
|
-
last_upload_at: number | null;
|
|
12
|
-
expires_at: number;
|
|
13
|
-
entry_count: number;
|
|
14
|
-
uploaded_byte_count: number;
|
|
15
|
-
}
|
|
16
|
-
interface GetUploadSessionResponse {
|
|
17
|
-
session: UploadSessionResponse | null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
namespace Files {
|
|
22
|
-
namespace v0 {
|
|
23
|
-
interface DirectoryItem {
|
|
24
|
-
name: string;
|
|
25
|
-
type: 'file' | 'directory' | 'symlink';
|
|
26
|
-
path: string;
|
|
27
|
-
modified: number;
|
|
28
|
-
created: number;
|
|
29
|
-
size?: number;
|
|
30
|
-
count?: number;
|
|
31
|
-
target?: string;
|
|
32
|
-
}
|
|
33
|
-
interface DirectoryResponse {
|
|
34
|
-
items: DirectoryItem[];
|
|
35
|
-
total: number;
|
|
36
|
-
current: number;
|
|
37
|
-
}
|
|
38
|
-
interface ExtractResult {
|
|
39
|
-
modpack_name: string | null;
|
|
40
|
-
conflicting_files: string[];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AbstractModule } from '../../../core/abstract-module';
|
|
2
|
-
import type { UploadHandle, UploadProgress } from '../../../types/upload';
|
|
3
|
-
import type { Kyros } from '../types';
|
|
4
|
-
export type UploadSessionFile = {
|
|
5
|
-
file: File | Blob;
|
|
6
|
-
filename: string;
|
|
7
|
-
};
|
|
8
|
-
export declare class KyrosUploadSessionsV1Module extends AbstractModule {
|
|
9
|
-
getModuleID(): string;
|
|
10
|
-
create(scope: Kyros.UploadSessions.v1.Scope, worldId: string): Promise<Kyros.UploadSessions.v1.UploadSessionResponse>;
|
|
11
|
-
get(scope: Kyros.UploadSessions.v1.Scope, worldId: string): Promise<Kyros.UploadSessions.v1.GetUploadSessionResponse>;
|
|
12
|
-
uploadFiles(scope: Kyros.UploadSessions.v1.Scope, worldId: string, uploadId: string, files: UploadSessionFile[], options?: {
|
|
13
|
-
onProgress?: (progress: UploadProgress) => void;
|
|
14
|
-
retry?: boolean | number;
|
|
15
|
-
}): UploadHandle<Kyros.UploadSessions.v1.UploadSessionResponse>;
|
|
16
|
-
finalize(scope: Kyros.UploadSessions.v1.Scope, worldId: string, uploadId: string): Promise<Kyros.UploadSessions.v1.UploadSessionResponse>;
|
|
17
|
-
cancel(scope: Kyros.UploadSessions.v1.Scope, worldId: string, uploadId: string): Promise<Kyros.UploadSessions.v1.UploadSessionResponse>;
|
|
18
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AbstractModule } from '../../../core/abstract-module';
|
|
2
|
-
import type { Labrinth } from '../types';
|
|
3
|
-
export declare class LabrinthAffiliateInternalModule extends AbstractModule {
|
|
4
|
-
getModuleID(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Get all affiliate codes for the authenticated user (or all if admin)
|
|
7
|
-
* GET /_internal/affiliate
|
|
8
|
-
*/
|
|
9
|
-
getAll(): Promise<Labrinth.Affiliate.Internal.AffiliateCode[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Create a new affiliate code
|
|
12
|
-
* PUT /_internal/affiliate
|
|
13
|
-
*/
|
|
14
|
-
create(data: Labrinth.Affiliate.Internal.CreateRequest): Promise<Labrinth.Affiliate.Internal.AffiliateCode>;
|
|
15
|
-
/**
|
|
16
|
-
* Get a specific affiliate code by ID
|
|
17
|
-
* GET /_internal/affiliate/{id}
|
|
18
|
-
*/
|
|
19
|
-
get(id: string): Promise<Labrinth.Affiliate.Internal.AffiliateCode>;
|
|
20
|
-
/**
|
|
21
|
-
* Delete an affiliate code
|
|
22
|
-
* DELETE /_internal/affiliate/{id}
|
|
23
|
-
*/
|
|
24
|
-
delete(id: string): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Update an affiliate code's source name
|
|
27
|
-
* PATCH /_internal/affiliate/{id}
|
|
28
|
-
*/
|
|
29
|
-
patch(id: string, data: Labrinth.Affiliate.Internal.PatchRequest): Promise<void>;
|
|
30
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { AbstractModule } from '../../../core/abstract-module';
|
|
2
|
-
import type { Labrinth } from '../types';
|
|
3
|
-
export declare class LabrinthAnalyticsV3Module extends AbstractModule {
|
|
4
|
-
getModuleID(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Fetch analytics data for the authenticated user's accessible projects
|
|
7
|
-
* and affiliate codes.
|
|
8
|
-
*
|
|
9
|
-
* @param data - Analytics request body defining time range and requested metrics
|
|
10
|
-
* @returns Promise resolving to the analytics response, with time slices in `metrics`
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* const response = await client.labrinth.analytics_v3.fetch({
|
|
15
|
-
* time_range: {
|
|
16
|
-
* start: '2026-01-01T00:00:00Z',
|
|
17
|
-
* end: '2026-02-01T00:00:00Z',
|
|
18
|
-
* resolution: { slices: 31 },
|
|
19
|
-
* },
|
|
20
|
-
* project_ids: ['A1B2C3D4'],
|
|
21
|
-
* return_metrics: {
|
|
22
|
-
* project_views: { bucket_by: ['project_id'] },
|
|
23
|
-
* },
|
|
24
|
-
* })
|
|
25
|
-
* const timeSlices = response.metrics
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
fetch(data: Labrinth.Analytics.v3.FetchRequest): Promise<Labrinth.Analytics.v3.FetchResponse>;
|
|
29
|
-
/**
|
|
30
|
-
* Fetch available analytics filter facets for the authenticated user's
|
|
31
|
-
* accessible projects.
|
|
32
|
-
*
|
|
33
|
-
* POST /v3/analytics/facets
|
|
34
|
-
*/
|
|
35
|
-
fetchFacets(data: Labrinth.Analytics.v3.FetchRequest): Promise<Labrinth.Analytics.v3.FacetsResponse>;
|
|
36
|
-
/**
|
|
37
|
-
* Fetch all analytics events.
|
|
38
|
-
* GET /v3/analytics-event
|
|
39
|
-
*/
|
|
40
|
-
getEvents(): Promise<Labrinth.Analytics.v3.AnalyticsEvent[]>;
|
|
41
|
-
/**
|
|
42
|
-
* Create an analytics event.
|
|
43
|
-
* POST /v3/analytics-event
|
|
44
|
-
*/
|
|
45
|
-
createEvent(data: Labrinth.Analytics.v3.AnalyticsEventUpsert): Promise<Labrinth.Analytics.v3.AnalyticsEvent>;
|
|
46
|
-
/**
|
|
47
|
-
* Edit an analytics event.
|
|
48
|
-
* PATCH /v3/analytics-event/{id}
|
|
49
|
-
*/
|
|
50
|
-
editEvent(id: Labrinth.Analytics.v3.AnalyticsEventId, data: Labrinth.Analytics.v3.AnalyticsEventUpsert): Promise<Labrinth.Analytics.v3.AnalyticsEvent>;
|
|
51
|
-
/**
|
|
52
|
-
* Delete an analytics event.
|
|
53
|
-
* DELETE /v3/analytics-event/{id}
|
|
54
|
-
*/
|
|
55
|
-
deleteEvent(id: Labrinth.Analytics.v3.AnalyticsEventId): Promise<void>;
|
|
56
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { AbstractModule } from '../../../core/abstract-module';
|
|
2
|
-
import type { Labrinth } from '../types';
|
|
3
|
-
export declare class LabrinthAttributionInternalModule extends AbstractModule {
|
|
4
|
-
getModuleID(): string;
|
|
5
|
-
/**
|
|
6
|
-
* List attribution groups for a project
|
|
7
|
-
* GET /_internal/attribution/{project_id}
|
|
8
|
-
*/
|
|
9
|
-
listProjectAttribution(projectId: string): Promise<Labrinth.Attribution.Internal.AttributionGroup[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Update an attribution group's attribution payload.
|
|
12
|
-
* PATCH /_internal/attribution/group/{group_id}
|
|
13
|
-
*
|
|
14
|
-
* @param groupId - The base62 attribution group id (as returned from listProjectAttribution).
|
|
15
|
-
*/
|
|
16
|
-
updateGroup(groupId: string, body: Labrinth.Attribution.Internal.UpdateGroupRequest): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Delete an attribution group and all files inside it.
|
|
19
|
-
* DELETE /_internal/attribution/group/{group_id}
|
|
20
|
-
*
|
|
21
|
-
* @param groupId - The base62 attribution group id (as returned from listProjectAttribution).
|
|
22
|
-
*/
|
|
23
|
-
deleteGroup(groupId: string): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Reassign a file (by sha1) to another attribution group within the same project.
|
|
26
|
-
* POST /_internal/attribution/assign
|
|
27
|
-
*
|
|
28
|
-
* @param body.target_group_id - The base62 id of the attribution group to assign the file to.
|
|
29
|
-
*/
|
|
30
|
-
assignFileToGroup(body: {
|
|
31
|
-
sha1: string;
|
|
32
|
-
target_group_id: string;
|
|
33
|
-
project_id: string;
|
|
34
|
-
}): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* Split a file (by sha1) out of its current attribution group into a new group.
|
|
37
|
-
* POST /_internal/attribution/split
|
|
38
|
-
*/
|
|
39
|
-
splitFile(body: Labrinth.Attribution.Internal.SplitRequest): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Scan a file for attribution information.
|
|
42
|
-
* POST /_internal/attribution/file/{file_id}/scan
|
|
43
|
-
*
|
|
44
|
-
* @param fileId - The file ID to scan.
|
|
45
|
-
*/
|
|
46
|
-
scanFile(fileId: string): Promise<Labrinth.Attribution.Internal.FileScanResponse>;
|
|
47
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AbstractModule } from '../../../core/abstract-module';
|
|
2
|
-
import type { Labrinth } from '../types';
|
|
3
|
-
export declare class LabrinthAuthInternalModule extends AbstractModule {
|
|
4
|
-
getModuleID(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Check if the user is subscribed to the newsletter
|
|
7
|
-
*
|
|
8
|
-
* @returns Promise resolving to the subscription status
|
|
9
|
-
*/
|
|
10
|
-
getNewsletterStatus(): Promise<Labrinth.Auth.Internal.SubscriptionStatus>;
|
|
11
|
-
/**
|
|
12
|
-
* Subscribe to the newsletter
|
|
13
|
-
*/
|
|
14
|
-
subscribeNewsletter(): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Create a signed Discord community bot handoff URL
|
|
17
|
-
*/
|
|
18
|
-
createDiscordCommunityLink(): Promise<Labrinth.Auth.Internal.DiscordCommunityLinkResponse>;
|
|
19
|
-
}
|