mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
feat: instances v2 (#6431)
* feat: base of instances v2 * feat: use old profiles with compat layer * prototype: instances v2 * fix: install_from using profile * fix: skins migration fix * fix: frontend still using profile path * fix: add update proj multiselect guard * fix: cargo fmt * fix: content missing fields * feat: break up app-lib/api/instance.rs * fix: check_content_updates mismatch * fix: updater modal cleanup w/new structure * feat: better update all handling * fix: remove preview_update_all * fix: feedback on bulk update + lint * fix: rem transitions * fix: change to jsonb * feat: app db backup after update * fix: lint * fix: sqlx prepare + use sqlx macros * fix: lint * fix: bugs * feat: defuck the installing process up * fix: bug of hell * fix: shear * fix: fmt * fix: install progress spacing + change mc/content/overrides to bytes * fix: lint * fix: prepr * fix: navtabs anim not working in app * fix: worlds.vue improvements + browse page fixes * feat: optimise queries + adapter fns * fix: lint * fix: lint * feat: shared modrinth-content-management crate (#6469) * feat: disable warnings setting * feat: add instances shortcuts (#6329) * Add modrinth://launch deep link to start a profile Support external profile launching via modrinth://launch/{profile_path} for integrations such as Stream Deck. * Change route to /launch/profile/{id} for future extensibility * fix: ensure profile path is url decoded * fix: URL-decode profile path from deep link * fix: use urlencoding crate for URL decoding * feat: implement app instance shortcuts * feat: change windows shortcut creation to use windows api instead * feat: implement creating a shortcut launching world/server * format * fmt * fix multiline inline tables * pnpm prepr * feat: move create shortcut to last item * refactor: split up shortcuts.rs for individual platforms * refactor: turn profile launch url into url type * use string literal and add safety comment * pt2 * refactor: rename anything that's profile into instance * update mac shortcut --------- Co-authored-by: DJCheesusReal <134006619+DJCheesusReal@users.noreply.github.com> --------- Co-authored-by: Truman Gao <106889354+tdgao@users.noreply.github.com> Co-authored-by: DJCheesusReal <134006619+DJCheesusReal@users.noreply.github.com>
This commit is contained in:
co-authored by
DJCheesusReal
Truman Gao
parent
ef4044534f
commit
734720e11e
@@ -26,6 +26,7 @@ import { LabrinthAuthV2Module } from './labrinth/auth/v2'
|
||||
import { LabrinthBillingInternalModule } from './labrinth/billing/internal'
|
||||
import { LabrinthCampaignInternalModule } from './labrinth/campaign/internal'
|
||||
import { LabrinthCollectionsModule } from './labrinth/collections'
|
||||
import { LabrinthContentV3Module } from './labrinth/content/v3'
|
||||
import { LabrinthExternalProjectsInternalModule } from './labrinth/external-projects/internal'
|
||||
import { LabrinthFriendsV3Module } from './labrinth/friends/v3'
|
||||
import { LabrinthGlobalsInternalModule } from './labrinth/globals/internal'
|
||||
@@ -97,6 +98,7 @@ export const MODULE_REGISTRY = {
|
||||
labrinth_billing_internal: LabrinthBillingInternalModule,
|
||||
labrinth_campaign_internal: LabrinthCampaignInternalModule,
|
||||
labrinth_collections: LabrinthCollectionsModule,
|
||||
labrinth_content_v3: LabrinthContentV3Module,
|
||||
labrinth_external_projects_internal: LabrinthExternalProjectsInternalModule,
|
||||
labrinth_friends_v3: LabrinthFriendsV3Module,
|
||||
labrinth_globals_internal: LabrinthGlobalsInternalModule,
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { AbstractModule } from '../../../core/abstract-module'
|
||||
import type { Labrinth } from '../types'
|
||||
|
||||
export class LabrinthContentV3Module extends AbstractModule {
|
||||
public getModuleID(): string {
|
||||
return 'labrinth_content_v3'
|
||||
}
|
||||
|
||||
public async resolve(
|
||||
request: Labrinth.Content.v3.ResolveContentRequest,
|
||||
): Promise<Labrinth.Content.v3.ResolveContentPlan> {
|
||||
return this.client.request<Labrinth.Content.v3.ResolveContentPlan>('/content/resolve', {
|
||||
api: 'labrinth',
|
||||
version: 3,
|
||||
method: 'POST',
|
||||
body: request,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ export * from './auth/internal'
|
||||
export * from './auth/v2'
|
||||
export * from './billing/internal'
|
||||
export * from './collections'
|
||||
export * from './content/v3'
|
||||
export * from './external-projects/internal'
|
||||
export * from './friends/v3'
|
||||
export * from './globals/internal'
|
||||
|
||||
@@ -2,6 +2,57 @@ import type { RawDecimal } from '../../utils/types'
|
||||
import type { ISO3166 } from '../iso3166/types'
|
||||
|
||||
export namespace Labrinth {
|
||||
export namespace Content {
|
||||
export namespace v3 {
|
||||
export type ContentType =
|
||||
| 'mod'
|
||||
| 'plugin'
|
||||
| 'datapack'
|
||||
| 'resourcepack'
|
||||
| 'shader'
|
||||
| 'modpack'
|
||||
|
||||
export type ResolutionPreferences = {
|
||||
game_versions?: string[]
|
||||
loaders?: string[]
|
||||
}
|
||||
|
||||
export type ResolveContentRequest = {
|
||||
project_id: string
|
||||
version_id?: string | null
|
||||
content_type: ContentType
|
||||
selected?: ResolutionPreferences
|
||||
target?: ResolutionPreferences
|
||||
existing_project_ids?: string[]
|
||||
}
|
||||
|
||||
export type ResolveContentPlan = {
|
||||
primary: ResolvedContent
|
||||
dependencies: ResolvedContent[]
|
||||
skipped: SkippedContent[]
|
||||
}
|
||||
|
||||
export type ResolvedContent = {
|
||||
project_id: string
|
||||
version_id: string
|
||||
dependent_on_version_id?: string | null
|
||||
}
|
||||
|
||||
export type SkippedContent = {
|
||||
project_id: string
|
||||
version_id?: string | null
|
||||
dependent_on_version_id?: string | null
|
||||
reason:
|
||||
| 'already_installed'
|
||||
| 'duplicate_project'
|
||||
| 'conflicting_dependency'
|
||||
| 'no_compatible_version'
|
||||
| 'missing_version'
|
||||
| 'quilt_fabric_api'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export namespace Campaign {
|
||||
export namespace Internal {
|
||||
export type CampaignInfo = {
|
||||
|
||||
Reference in New Issue
Block a user