curseforge-js 1.0.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/README.md +164 -0
- package/dist/client/categories.d.ts +13 -0
- package/dist/client/categories.d.ts.map +1 -0
- package/dist/client/categories.js +18 -0
- package/dist/client/categories.js.map +1 -0
- package/dist/client/core.d.ts +16 -0
- package/dist/client/core.d.ts.map +1 -0
- package/dist/client/core.js +62 -0
- package/dist/client/core.js.map +1 -0
- package/dist/client/curseforge.d.ts +27 -0
- package/dist/client/curseforge.d.ts.map +1 -0
- package/dist/client/curseforge.js +35 -0
- package/dist/client/curseforge.js.map +1 -0
- package/dist/client/files.d.ts +19 -0
- package/dist/client/files.d.ts.map +1 -0
- package/dist/client/files.js +32 -0
- package/dist/client/files.js.map +1 -0
- package/dist/client/fingerprints.d.ts +12 -0
- package/dist/client/fingerprints.d.ts.map +1 -0
- package/dist/client/fingerprints.js +24 -0
- package/dist/client/fingerprints.js.map +1 -0
- package/dist/client/games.d.ts +19 -0
- package/dist/client/games.d.ts.map +1 -0
- package/dist/client/games.js +32 -0
- package/dist/client/games.js.map +1 -0
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +9 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/minecraft.d.ts +16 -0
- package/dist/client/minecraft.d.ts.map +1 -0
- package/dist/client/minecraft.js +28 -0
- package/dist/client/minecraft.js.map +1 -0
- package/dist/client/mods.d.ts +19 -0
- package/dist/client/mods.d.ts.map +1 -0
- package/dist/client/mods.js +45 -0
- package/dist/client/mods.js.map +1 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +14 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/types/base.d.ts +49 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +2 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/categories.d.ts +35 -0
- package/dist/types/categories.d.ts.map +1 -0
- package/dist/types/categories.js +2 -0
- package/dist/types/categories.js.map +1 -0
- package/dist/types/files.d.ts +146 -0
- package/dist/types/files.d.ts.map +1 -0
- package/dist/types/files.js +51 -0
- package/dist/types/files.js.map +1 -0
- package/dist/types/fingerprints.d.ts +44 -0
- package/dist/types/fingerprints.d.ts.map +1 -0
- package/dist/types/fingerprints.js +2 -0
- package/dist/types/fingerprints.js.map +1 -0
- package/dist/types/games.d.ts +70 -0
- package/dist/types/games.d.ts.map +1 -0
- package/dist/types/games.js +30 -0
- package/dist/types/games.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/minecraft.d.ts +84 -0
- package/dist/types/minecraft.d.ts.map +1 -0
- package/dist/types/minecraft.js +22 -0
- package/dist/types/minecraft.js.map +1 -0
- package/dist/types/mods.d.ts +171 -0
- package/dist/types/mods.d.ts.map +1 -0
- package/dist/types/mods.js +31 -0
- package/dist/types/mods.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/request.d.ts +21 -0
- package/dist/utils/request.d.ts.map +1 -0
- package/dist/utils/request.js +96 -0
- package/dist/utils/request.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CurseForgeClientCore } from './core.js';
|
|
2
|
+
import type { FeaturedModsResponse, GetFeaturedModsRequestBody, GetModDescriptionOptions, GetModsByIdsListRequestBody, Mod, SearchModsOptions } from '../types/index.js';
|
|
3
|
+
import type { CurseForgePaginatedResponse } from '../types/base.js';
|
|
4
|
+
/** API namespace for mods. */
|
|
5
|
+
export declare class ModsApi {
|
|
6
|
+
private readonly core;
|
|
7
|
+
constructor(core: CurseForgeClientCore);
|
|
8
|
+
/** Returns all mods that match the given search criteria. */
|
|
9
|
+
search(options: SearchModsOptions): Promise<CurseForgePaginatedResponse<Mod>>;
|
|
10
|
+
/** Returns a single mod. */
|
|
11
|
+
get(modId: number): Promise<Mod>;
|
|
12
|
+
/** Returns a list of mods belonging to the same game. */
|
|
13
|
+
getMods(body: GetModsByIdsListRequestBody): Promise<Mod[]>;
|
|
14
|
+
/** Returns a list of featured, popular, and recently updated mods. */
|
|
15
|
+
getFeatured(body: GetFeaturedModsRequestBody): Promise<FeaturedModsResponse>;
|
|
16
|
+
/** Returns the full description of a mod in HTML format. */
|
|
17
|
+
getDescription(modId: number, options?: GetModDescriptionOptions): Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=mods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mods.d.ts","sourceRoot":"","sources":["../../src/client/mods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,EAC3B,GAAG,EACH,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAsB,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAGxF,8BAA8B;AAC9B,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,oBAAoB;IAEvD,6DAA6D;IACvD,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC;IAanF,4BAA4B;IACtB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAKtC,yDAAyD;IACnD,OAAO,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAKhE,sEAAsE;IAChE,WAAW,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAOlF,4DAA4D;IACtD,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;CAMzF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { toArrayParam } from '../utils/request.js';
|
|
2
|
+
/** API namespace for mods. */
|
|
3
|
+
export class ModsApi {
|
|
4
|
+
core;
|
|
5
|
+
constructor(core) {
|
|
6
|
+
this.core = core;
|
|
7
|
+
}
|
|
8
|
+
/** Returns all mods that match the given search criteria. */
|
|
9
|
+
async search(options) {
|
|
10
|
+
const { categoryIds, gameVersions, modLoaderTypes, ...rest } = options;
|
|
11
|
+
return this.core.requestJson('v1/mods/search', {
|
|
12
|
+
query: {
|
|
13
|
+
...rest,
|
|
14
|
+
categoryIds: toArrayParam(categoryIds),
|
|
15
|
+
gameVersions: toArrayParam(gameVersions),
|
|
16
|
+
modLoaderTypes: toArrayParam(modLoaderTypes),
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** Returns a single mod. */
|
|
21
|
+
async get(modId) {
|
|
22
|
+
const response = await this.core.requestJson(`v1/mods/${modId}`);
|
|
23
|
+
return response.data;
|
|
24
|
+
}
|
|
25
|
+
/** Returns a list of mods belonging to the same game. */
|
|
26
|
+
async getMods(body) {
|
|
27
|
+
const response = await this.core.requestJson('v1/mods', { body });
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
/** Returns a list of featured, popular, and recently updated mods. */
|
|
31
|
+
async getFeatured(body) {
|
|
32
|
+
const response = await this.core.requestJson('v1/mods/featured', {
|
|
33
|
+
body,
|
|
34
|
+
});
|
|
35
|
+
return response.data;
|
|
36
|
+
}
|
|
37
|
+
/** Returns the full description of a mod in HTML format. */
|
|
38
|
+
async getDescription(modId, options) {
|
|
39
|
+
const response = await this.core.requestJson(`v1/mods/${modId}/description`, {
|
|
40
|
+
query: options,
|
|
41
|
+
});
|
|
42
|
+
return response.data;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=mods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mods.js","sourceRoot":"","sources":["../../src/client/mods.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,8BAA8B;AAC9B,MAAM,OAAO,OAAO;IACW;IAA7B,YAA6B,IAA0B;QAA1B,SAAI,GAAJ,IAAI,CAAsB;IAAG,CAAC;IAE3D,6DAA6D;IAC7D,KAAK,CAAC,MAAM,CAAC,OAA0B;QACrC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;QAEvE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAmC,gBAAgB,EAAE;YAC/E,KAAK,EAAE;gBACL,GAAG,IAAI;gBACP,WAAW,EAAE,YAAY,CAAC,WAAW,CAAC;gBACtC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC;gBACxC,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC;aAC7C;SACF,CAAC,CAAC;IACL,CAAC;IAED,4BAA4B;IAC5B,KAAK,CAAC,GAAG,CAAC,KAAa;QACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAA0B,WAAW,KAAK,EAAE,CAAC,CAAC;QAC1F,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,yDAAyD;IACzD,KAAK,CAAC,OAAO,CAAC,IAAiC;QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAA4B,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7F,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,sEAAsE;IACtE,KAAK,CAAC,WAAW,CAAC,IAAgC;QAChD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAA2C,kBAAkB,EAAE;YACzG,IAAI;SACL,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,cAAc,CAAC,KAAa,EAAE,OAAkC;QACpE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAA6B,WAAW,KAAK,cAAc,EAAE;YACvG,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Error thrown for request failures, timeouts, and CurseForge API errors. */
|
|
2
|
+
export declare class CurseForgeError extends Error {
|
|
3
|
+
name: "CurseForgeError";
|
|
4
|
+
status: number;
|
|
5
|
+
response: Response | undefined;
|
|
6
|
+
body: unknown;
|
|
7
|
+
constructor(message: string, options?: {
|
|
8
|
+
status?: number;
|
|
9
|
+
response?: Response;
|
|
10
|
+
body?: unknown;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qBAAa,eAAgB,SAAQ,KAAK;IAC/B,IAAI,EAAG,iBAAiB,CAAU;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;gBAEF,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE;QACpC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,IAAI,CAAC,EAAE,OAAO,CAAC;KACX;CAMP"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Error thrown for request failures, timeouts, and CurseForge API errors. */
|
|
2
|
+
export class CurseForgeError extends Error {
|
|
3
|
+
name = 'CurseForgeError';
|
|
4
|
+
status;
|
|
5
|
+
response;
|
|
6
|
+
body;
|
|
7
|
+
constructor(message, options = {}) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.status = options.status ?? 0;
|
|
10
|
+
this.response = options.response;
|
|
11
|
+
this.body = options.body;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,IAAI,GAAG,iBAA0B,CAAC;IAC3C,MAAM,CAAS;IACf,QAAQ,CAAuB;IAC/B,IAAI,CAAU;IAEd,YAAY,OAAe,EAAE,UAIzB,EAAE;QACJ,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** A value that can be serialized as a URL query parameter. */
|
|
2
|
+
export type QueryValue = string | number | boolean | null | undefined | Array<string | number | boolean>;
|
|
3
|
+
/** Pagination metadata included in paginated API responses. */
|
|
4
|
+
export interface Pagination {
|
|
5
|
+
/** Zero-based index of the first item included in the response. */
|
|
6
|
+
index: number;
|
|
7
|
+
/** Requested number of items to include in the response. */
|
|
8
|
+
pageSize: number;
|
|
9
|
+
/** Actual number of items included in the response. */
|
|
10
|
+
resultCount: number;
|
|
11
|
+
/** Total number of items available by the request. */
|
|
12
|
+
totalCount: number;
|
|
13
|
+
}
|
|
14
|
+
/** Envelope returned by non-paginated CurseForge endpoints. */
|
|
15
|
+
export interface CurseForgeResponse<T> {
|
|
16
|
+
data: T;
|
|
17
|
+
}
|
|
18
|
+
/** Envelope returned by paginated CurseForge endpoints. */
|
|
19
|
+
export interface CurseForgePaginatedResponse<T> {
|
|
20
|
+
data: T[];
|
|
21
|
+
pagination: Pagination;
|
|
22
|
+
}
|
|
23
|
+
/** Common query parameters for paginated endpoints. */
|
|
24
|
+
export interface PaginationOptions {
|
|
25
|
+
/** Zero-based index of the first item to include. `index + pageSize` must not exceed 10,000. */
|
|
26
|
+
index?: number;
|
|
27
|
+
/** Number of items to include in the response (maximum and default 50). */
|
|
28
|
+
pageSize?: number;
|
|
29
|
+
}
|
|
30
|
+
/** Options for creating a {@link CurseForgeClient}. */
|
|
31
|
+
export interface CurseForgeClientOptions {
|
|
32
|
+
/**
|
|
33
|
+
* Base URL of the CurseForge API.
|
|
34
|
+
* @defaultValue "https://api.curseforge.com"
|
|
35
|
+
*/
|
|
36
|
+
baseUrl?: string;
|
|
37
|
+
/** API key sent as the `x-api-key` header on every request. */
|
|
38
|
+
apiKey?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Request timeout in milliseconds.
|
|
41
|
+
* @defaultValue 10000
|
|
42
|
+
*/
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
/** Value to send as the `User-Agent` header on every request. */
|
|
45
|
+
userAgent?: string;
|
|
46
|
+
/** Custom fetch implementation. */
|
|
47
|
+
fetch?: typeof globalThis.fetch;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAEzG,+DAA+D;AAC/D,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,+DAA+D;AAC/D,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC;CACT;AAED,2DAA2D;AAC3D,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,gGAAgG;IAChG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,uDAAuD;AACvD,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** A mod category or class. */
|
|
2
|
+
export interface Category {
|
|
3
|
+
/** The category id. */
|
|
4
|
+
id: number;
|
|
5
|
+
/** The game id related to the category. */
|
|
6
|
+
gameId: number;
|
|
7
|
+
/** Category name. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The category slug as it appears in the URL. */
|
|
10
|
+
slug: string;
|
|
11
|
+
/** The category URL. */
|
|
12
|
+
url: string;
|
|
13
|
+
/** URL for the category icon. */
|
|
14
|
+
iconUrl: string;
|
|
15
|
+
/** Last modified date of the category. */
|
|
16
|
+
dateModified: string;
|
|
17
|
+
/** Whether this is a top level category for other categories (a "class"). */
|
|
18
|
+
isClass: boolean | null;
|
|
19
|
+
/** The class id of the category, meaning the class of which this category is under. */
|
|
20
|
+
classId: number | null;
|
|
21
|
+
/** The parent category for this category. */
|
|
22
|
+
parentCategoryId: number | null;
|
|
23
|
+
/** The display index for this category. */
|
|
24
|
+
displayIndex: number | null;
|
|
25
|
+
}
|
|
26
|
+
/** Query parameters for {@link CategoriesApi.list}. */
|
|
27
|
+
export interface GetCategoriesOptions {
|
|
28
|
+
/** A game unique id. */
|
|
29
|
+
gameId: number;
|
|
30
|
+
/** A class unique id. */
|
|
31
|
+
classId?: number;
|
|
32
|
+
/** Used with `gameId` to return only the classes for that game. */
|
|
33
|
+
classesOnly?: boolean;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../src/types/categories.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,WAAW,QAAQ;IACvB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,uFAAuF;IACvF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6CAA6C;IAC7C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,2CAA2C;IAC3C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,uDAAuD;AACvD,MAAM,WAAW,oBAAoB;IACnC,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/types/categories.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { PaginationOptions } from './base.js';
|
|
2
|
+
import type { ModLoaderType } from './minecraft.js';
|
|
3
|
+
/** The release type of a mod file. */
|
|
4
|
+
export declare enum FileReleaseType {
|
|
5
|
+
Release = 1,
|
|
6
|
+
Beta = 2,
|
|
7
|
+
Alpha = 3
|
|
8
|
+
}
|
|
9
|
+
/** The processing/publishing status of a mod file. */
|
|
10
|
+
export declare enum FileStatus {
|
|
11
|
+
Processing = 1,
|
|
12
|
+
ChangesRequired = 2,
|
|
13
|
+
UnderReview = 3,
|
|
14
|
+
Approved = 4,
|
|
15
|
+
Rejected = 5,
|
|
16
|
+
MalwareDetected = 6,
|
|
17
|
+
Deleted = 7,
|
|
18
|
+
Archived = 8,
|
|
19
|
+
Testing = 9,
|
|
20
|
+
Released = 10,
|
|
21
|
+
ReadyForReview = 11,
|
|
22
|
+
Deprecated = 12,
|
|
23
|
+
Baking = 13,
|
|
24
|
+
AwaitingPublishing = 14,
|
|
25
|
+
FailedPublishing = 15,
|
|
26
|
+
Cooking = 16,
|
|
27
|
+
Cooked = 17,
|
|
28
|
+
UnderManualReview = 18,
|
|
29
|
+
ScanningForMalware = 19,
|
|
30
|
+
ProcessingFile = 20,
|
|
31
|
+
PendingRelease = 21,
|
|
32
|
+
ReadyForCooking = 22,
|
|
33
|
+
PostProcessing = 23
|
|
34
|
+
}
|
|
35
|
+
/** How a file relates to another file it depends on. */
|
|
36
|
+
export declare enum FileRelationType {
|
|
37
|
+
EmbeddedLibrary = 1,
|
|
38
|
+
OptionalDependency = 2,
|
|
39
|
+
RequiredDependency = 3,
|
|
40
|
+
Tool = 4,
|
|
41
|
+
Incompatible = 5,
|
|
42
|
+
Include = 6
|
|
43
|
+
}
|
|
44
|
+
/** Hashing algorithm used for a {@link FileHash}. */
|
|
45
|
+
export declare enum HashAlgo {
|
|
46
|
+
Sha1 = 1,
|
|
47
|
+
Md5 = 2
|
|
48
|
+
}
|
|
49
|
+
/** A hash of a mod file. */
|
|
50
|
+
export interface FileHash {
|
|
51
|
+
value: string;
|
|
52
|
+
algo: HashAlgo;
|
|
53
|
+
}
|
|
54
|
+
/** A dependency of a mod file on another mod. */
|
|
55
|
+
export interface FileDependency {
|
|
56
|
+
modId: number;
|
|
57
|
+
relationType: FileRelationType;
|
|
58
|
+
}
|
|
59
|
+
/** A submodule of a mod file, identified by its own fingerprint. */
|
|
60
|
+
export interface FileModule {
|
|
61
|
+
name: string;
|
|
62
|
+
fingerprint: number;
|
|
63
|
+
}
|
|
64
|
+
/** Metadata used for sorting files by game version. */
|
|
65
|
+
export interface SortableGameVersion {
|
|
66
|
+
/** Original version name (e.g. `1.5b`). */
|
|
67
|
+
gameVersionName: string;
|
|
68
|
+
/** Used for sorting, ordinarily padded with zeroes (e.g. `0000000001.0000000005`). */
|
|
69
|
+
gameVersionPadded: string;
|
|
70
|
+
/** Game version clean name (e.g. `1.5`). */
|
|
71
|
+
gameVersion: string;
|
|
72
|
+
/** Game version release date. */
|
|
73
|
+
gameVersionReleaseDate: string;
|
|
74
|
+
/** Game version type id. */
|
|
75
|
+
gameVersionTypeId: number | null;
|
|
76
|
+
}
|
|
77
|
+
/** Condensed index entry describing one of a mod's latest files. */
|
|
78
|
+
export interface FileIndex {
|
|
79
|
+
gameVersion: string;
|
|
80
|
+
fileId: number;
|
|
81
|
+
filename: string;
|
|
82
|
+
releaseType: FileReleaseType;
|
|
83
|
+
gameVersionTypeId: number | null;
|
|
84
|
+
modLoader: ModLoaderType;
|
|
85
|
+
}
|
|
86
|
+
/** A file (version) of a mod. */
|
|
87
|
+
export interface File {
|
|
88
|
+
/** The file id. */
|
|
89
|
+
id: number;
|
|
90
|
+
/** The game id related to the mod that this file belongs to. */
|
|
91
|
+
gameId: number;
|
|
92
|
+
/** The mod id. */
|
|
93
|
+
modId: number;
|
|
94
|
+
/** Whether the file is available to download. */
|
|
95
|
+
isAvailable: boolean;
|
|
96
|
+
/** Display name of the file. */
|
|
97
|
+
displayName: string;
|
|
98
|
+
/** Exact file name. */
|
|
99
|
+
fileName: string;
|
|
100
|
+
/** The file release type. */
|
|
101
|
+
releaseType: FileReleaseType;
|
|
102
|
+
/** Status of the file. */
|
|
103
|
+
fileStatus: FileStatus;
|
|
104
|
+
/** The file hash(es) (e.g. md5 or sha1). */
|
|
105
|
+
hashes: FileHash[];
|
|
106
|
+
/** The file timestamp. */
|
|
107
|
+
fileDate: string;
|
|
108
|
+
/** The file length in bytes. */
|
|
109
|
+
fileLength: number;
|
|
110
|
+
/** The number of downloads for the file. */
|
|
111
|
+
downloadCount: number;
|
|
112
|
+
/** The file's size on disk. */
|
|
113
|
+
fileSizeOnDisk: number | null;
|
|
114
|
+
/** The file download URL. */
|
|
115
|
+
downloadUrl: string;
|
|
116
|
+
/** List of game versions this file is relevant for. */
|
|
117
|
+
gameVersions: string[];
|
|
118
|
+
/** Metadata used for sorting by game versions. */
|
|
119
|
+
sortableGameVersions: SortableGameVersion[];
|
|
120
|
+
/** List of dependency files. */
|
|
121
|
+
dependencies: FileDependency[];
|
|
122
|
+
exposeAsAlternative: boolean | null;
|
|
123
|
+
parentProjectFileId: number | null;
|
|
124
|
+
alternateFileId: number | null;
|
|
125
|
+
isServerPack: boolean | null;
|
|
126
|
+
serverPackFileId: number | null;
|
|
127
|
+
isEarlyAccessContent: boolean | null;
|
|
128
|
+
earlyAccessEndDate: string | null;
|
|
129
|
+
fileFingerprint: number;
|
|
130
|
+
modules: FileModule[];
|
|
131
|
+
}
|
|
132
|
+
/** Request body for {@link FilesApi.getFiles}. */
|
|
133
|
+
export interface GetModFilesRequestBody {
|
|
134
|
+
/** List of file ids to fetch. */
|
|
135
|
+
fileIds: number[];
|
|
136
|
+
}
|
|
137
|
+
/** Query parameters for {@link FilesApi.list}. */
|
|
138
|
+
export interface GetModFilesOptions extends PaginationOptions {
|
|
139
|
+
/** Filter by game version string. */
|
|
140
|
+
gameVersion?: string;
|
|
141
|
+
/** Filter files associated with the given mod loader (Forge, Fabric, ...). */
|
|
142
|
+
modLoaderType?: ModLoaderType;
|
|
143
|
+
/** Filter files tagged with versions of the given game version type id. */
|
|
144
|
+
gameVersionTypeId?: number;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/types/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,sCAAsC;AACtC,oBAAY,eAAe;IACzB,OAAO,IAAI;IACX,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED,sDAAsD;AACtD,oBAAY,UAAU;IACpB,UAAU,IAAI;IACd,eAAe,IAAI;IACnB,WAAW,IAAI;IACf,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,eAAe,IAAI;IACnB,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,QAAQ,KAAK;IACb,cAAc,KAAK;IACnB,UAAU,KAAK;IACf,MAAM,KAAK;IACX,kBAAkB,KAAK;IACvB,gBAAgB,KAAK;IACrB,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,iBAAiB,KAAK;IACtB,kBAAkB,KAAK;IACvB,cAAc,KAAK;IACnB,cAAc,KAAK;IACnB,eAAe,KAAK;IACpB,cAAc,KAAK;CACpB;AAED,wDAAwD;AACxD,oBAAY,gBAAgB;IAC1B,eAAe,IAAI;IACnB,kBAAkB,IAAI;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AC,EAAE,aAAa,CAAC;IAC9B,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** The release type of a mod file. */
|
|
2
|
+
export var FileReleaseType;
|
|
3
|
+
(function (FileReleaseType) {
|
|
4
|
+
FileReleaseType[FileReleaseType["Release"] = 1] = "Release";
|
|
5
|
+
FileReleaseType[FileReleaseType["Beta"] = 2] = "Beta";
|
|
6
|
+
FileReleaseType[FileReleaseType["Alpha"] = 3] = "Alpha";
|
|
7
|
+
})(FileReleaseType || (FileReleaseType = {}));
|
|
8
|
+
/** The processing/publishing status of a mod file. */
|
|
9
|
+
export var FileStatus;
|
|
10
|
+
(function (FileStatus) {
|
|
11
|
+
FileStatus[FileStatus["Processing"] = 1] = "Processing";
|
|
12
|
+
FileStatus[FileStatus["ChangesRequired"] = 2] = "ChangesRequired";
|
|
13
|
+
FileStatus[FileStatus["UnderReview"] = 3] = "UnderReview";
|
|
14
|
+
FileStatus[FileStatus["Approved"] = 4] = "Approved";
|
|
15
|
+
FileStatus[FileStatus["Rejected"] = 5] = "Rejected";
|
|
16
|
+
FileStatus[FileStatus["MalwareDetected"] = 6] = "MalwareDetected";
|
|
17
|
+
FileStatus[FileStatus["Deleted"] = 7] = "Deleted";
|
|
18
|
+
FileStatus[FileStatus["Archived"] = 8] = "Archived";
|
|
19
|
+
FileStatus[FileStatus["Testing"] = 9] = "Testing";
|
|
20
|
+
FileStatus[FileStatus["Released"] = 10] = "Released";
|
|
21
|
+
FileStatus[FileStatus["ReadyForReview"] = 11] = "ReadyForReview";
|
|
22
|
+
FileStatus[FileStatus["Deprecated"] = 12] = "Deprecated";
|
|
23
|
+
FileStatus[FileStatus["Baking"] = 13] = "Baking";
|
|
24
|
+
FileStatus[FileStatus["AwaitingPublishing"] = 14] = "AwaitingPublishing";
|
|
25
|
+
FileStatus[FileStatus["FailedPublishing"] = 15] = "FailedPublishing";
|
|
26
|
+
FileStatus[FileStatus["Cooking"] = 16] = "Cooking";
|
|
27
|
+
FileStatus[FileStatus["Cooked"] = 17] = "Cooked";
|
|
28
|
+
FileStatus[FileStatus["UnderManualReview"] = 18] = "UnderManualReview";
|
|
29
|
+
FileStatus[FileStatus["ScanningForMalware"] = 19] = "ScanningForMalware";
|
|
30
|
+
FileStatus[FileStatus["ProcessingFile"] = 20] = "ProcessingFile";
|
|
31
|
+
FileStatus[FileStatus["PendingRelease"] = 21] = "PendingRelease";
|
|
32
|
+
FileStatus[FileStatus["ReadyForCooking"] = 22] = "ReadyForCooking";
|
|
33
|
+
FileStatus[FileStatus["PostProcessing"] = 23] = "PostProcessing";
|
|
34
|
+
})(FileStatus || (FileStatus = {}));
|
|
35
|
+
/** How a file relates to another file it depends on. */
|
|
36
|
+
export var FileRelationType;
|
|
37
|
+
(function (FileRelationType) {
|
|
38
|
+
FileRelationType[FileRelationType["EmbeddedLibrary"] = 1] = "EmbeddedLibrary";
|
|
39
|
+
FileRelationType[FileRelationType["OptionalDependency"] = 2] = "OptionalDependency";
|
|
40
|
+
FileRelationType[FileRelationType["RequiredDependency"] = 3] = "RequiredDependency";
|
|
41
|
+
FileRelationType[FileRelationType["Tool"] = 4] = "Tool";
|
|
42
|
+
FileRelationType[FileRelationType["Incompatible"] = 5] = "Incompatible";
|
|
43
|
+
FileRelationType[FileRelationType["Include"] = 6] = "Include";
|
|
44
|
+
})(FileRelationType || (FileRelationType = {}));
|
|
45
|
+
/** Hashing algorithm used for a {@link FileHash}. */
|
|
46
|
+
export var HashAlgo;
|
|
47
|
+
(function (HashAlgo) {
|
|
48
|
+
HashAlgo[HashAlgo["Sha1"] = 1] = "Sha1";
|
|
49
|
+
HashAlgo[HashAlgo["Md5"] = 2] = "Md5";
|
|
50
|
+
})(HashAlgo || (HashAlgo = {}));
|
|
51
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/types/files.ts"],"names":[],"mappings":"AAGA,sCAAsC;AACtC,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,2DAAW,CAAA;IACX,qDAAQ,CAAA;IACR,uDAAS,CAAA;AACX,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AAED,sDAAsD;AACtD,MAAM,CAAN,IAAY,UAwBX;AAxBD,WAAY,UAAU;IACpB,uDAAc,CAAA;IACd,iEAAmB,CAAA;IACnB,yDAAe,CAAA;IACf,mDAAY,CAAA;IACZ,mDAAY,CAAA;IACZ,iEAAmB,CAAA;IACnB,iDAAW,CAAA;IACX,mDAAY,CAAA;IACZ,iDAAW,CAAA;IACX,oDAAa,CAAA;IACb,gEAAmB,CAAA;IACnB,wDAAe,CAAA;IACf,gDAAW,CAAA;IACX,wEAAuB,CAAA;IACvB,oEAAqB,CAAA;IACrB,kDAAY,CAAA;IACZ,gDAAW,CAAA;IACX,sEAAsB,CAAA;IACtB,wEAAuB,CAAA;IACvB,gEAAmB,CAAA;IACnB,gEAAmB,CAAA;IACnB,kEAAoB,CAAA;IACpB,gEAAmB,CAAA;AACrB,CAAC,EAxBW,UAAU,KAAV,UAAU,QAwBrB;AAED,wDAAwD;AACxD,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,6EAAmB,CAAA;IACnB,mFAAsB,CAAA;IACtB,mFAAsB,CAAA;IACtB,uDAAQ,CAAA;IACR,uEAAgB,CAAA;IAChB,6DAAW,CAAA;AACb,CAAC,EAPW,gBAAgB,KAAhB,gBAAgB,QAO3B;AAED,qDAAqD;AACrD,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uCAAQ,CAAA;IACR,qCAAO,CAAA;AACT,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { File } from './files.js';
|
|
2
|
+
/** A folder of mod files identified together by their fingerprints, for fuzzy matching. */
|
|
3
|
+
export interface FolderFingerprint {
|
|
4
|
+
foldername: string;
|
|
5
|
+
fingerprints: number[];
|
|
6
|
+
}
|
|
7
|
+
/** An exact fingerprint match for a mod file. */
|
|
8
|
+
export interface FingerprintMatch {
|
|
9
|
+
id: number;
|
|
10
|
+
file: File;
|
|
11
|
+
latestFiles: File[];
|
|
12
|
+
}
|
|
13
|
+
/** A fuzzy fingerprint match for a mod file. */
|
|
14
|
+
export interface FingerprintFuzzyMatch {
|
|
15
|
+
id: number;
|
|
16
|
+
file: File;
|
|
17
|
+
latestFiles: File[];
|
|
18
|
+
fingerprints: number[];
|
|
19
|
+
}
|
|
20
|
+
/** Result of matching a list of fingerprints against CurseForge's file index. */
|
|
21
|
+
export interface FingerprintsMatchesResult {
|
|
22
|
+
isCacheBuilt: boolean;
|
|
23
|
+
exactMatches: FingerprintMatch[];
|
|
24
|
+
exactFingerprints: number[];
|
|
25
|
+
partialMatches: FingerprintMatch[];
|
|
26
|
+
/** Partially matched fingerprints, keyed by fingerprint. */
|
|
27
|
+
partialMatchFingerprints: Record<string, number[]>;
|
|
28
|
+
installedFingerprints: number[];
|
|
29
|
+
unmatchedFingerprints: number[];
|
|
30
|
+
}
|
|
31
|
+
/** Result of fuzzy-matching a list of folder fingerprints against CurseForge's file index. */
|
|
32
|
+
export interface FingerprintFuzzyMatchResult {
|
|
33
|
+
fuzzyMatches: FingerprintFuzzyMatch[];
|
|
34
|
+
}
|
|
35
|
+
/** Request body for {@link FingerprintsApi.getMatches}. */
|
|
36
|
+
export interface GetFingerprintMatchesRequestBody {
|
|
37
|
+
fingerprints: number[];
|
|
38
|
+
}
|
|
39
|
+
/** Request body for {@link FingerprintsApi.getFuzzyMatches}. */
|
|
40
|
+
export interface GetFuzzyMatchesRequestBody {
|
|
41
|
+
gameId?: number;
|
|
42
|
+
fingerprints: FolderFingerprint[];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=fingerprints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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
|
1
|
+
{"version":3,"file":"fingerprints.js","sourceRoot":"","sources":["../../src/types/fingerprints.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { PaginationOptions } from './base.js';
|
|
2
|
+
/** Approval/lifecycle status of a game, category, or other core entity. */
|
|
3
|
+
export declare enum CoreStatus {
|
|
4
|
+
Draft = 1,
|
|
5
|
+
Test = 2,
|
|
6
|
+
PendingReview = 3,
|
|
7
|
+
Rejected = 4,
|
|
8
|
+
Approved = 5,
|
|
9
|
+
Live = 6
|
|
10
|
+
}
|
|
11
|
+
/** Visibility of a game's API. */
|
|
12
|
+
export declare enum CoreApiStatus {
|
|
13
|
+
Private = 1,
|
|
14
|
+
Public = 2
|
|
15
|
+
}
|
|
16
|
+
/** Approval status of a game version. */
|
|
17
|
+
export declare enum GameVersionStatus {
|
|
18
|
+
Approved = 1,
|
|
19
|
+
Deleted = 2,
|
|
20
|
+
New = 3
|
|
21
|
+
}
|
|
22
|
+
/** Status of a game version type. */
|
|
23
|
+
export declare enum GameVersionTypeStatus {
|
|
24
|
+
Normal = 1,
|
|
25
|
+
Deleted = 2
|
|
26
|
+
}
|
|
27
|
+
/** Icon, tile and cover art for a game. */
|
|
28
|
+
export interface GameAssets {
|
|
29
|
+
iconUrl: string;
|
|
30
|
+
tileUrl: string;
|
|
31
|
+
coverUrl: string;
|
|
32
|
+
}
|
|
33
|
+
/** A game available on CurseForge. */
|
|
34
|
+
export interface Game {
|
|
35
|
+
id: number;
|
|
36
|
+
name: string;
|
|
37
|
+
slug: string;
|
|
38
|
+
dateModified: string;
|
|
39
|
+
assets: GameAssets;
|
|
40
|
+
status: CoreStatus;
|
|
41
|
+
apiStatus: CoreApiStatus;
|
|
42
|
+
}
|
|
43
|
+
/** A single named/sluggable version of a game (used by the v2 versions endpoint). */
|
|
44
|
+
export interface GameVersion {
|
|
45
|
+
id: number;
|
|
46
|
+
slug: string;
|
|
47
|
+
name: string;
|
|
48
|
+
}
|
|
49
|
+
/** Game versions grouped by version type (v1 form — plain version strings). */
|
|
50
|
+
export interface GameVersionsByType {
|
|
51
|
+
type: number;
|
|
52
|
+
versions: string[];
|
|
53
|
+
}
|
|
54
|
+
/** Game versions grouped by version type (v2 form — full version objects). */
|
|
55
|
+
export interface GameVersionsByType2 {
|
|
56
|
+
type: number;
|
|
57
|
+
versions: GameVersion[];
|
|
58
|
+
}
|
|
59
|
+
/** A version type belonging to a game (e.g. Minecraft game versions vs. Minecraft mod loaders). */
|
|
60
|
+
export interface GameVersionType {
|
|
61
|
+
id: number;
|
|
62
|
+
gameId: number;
|
|
63
|
+
name: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
isSyncable: boolean;
|
|
66
|
+
status: GameVersionTypeStatus;
|
|
67
|
+
}
|
|
68
|
+
/** Query parameters for {@link GamesApi.list}. */
|
|
69
|
+
export type GetGamesOptions = PaginationOptions;
|
|
70
|
+
//# sourceMappingURL=games.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"games.d.ts","sourceRoot":"","sources":["../../src/types/games.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,2EAA2E;AAC3E,oBAAY,UAAU;IACpB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,aAAa,IAAI;IACjB,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,IAAI,IAAI;CACT;AAED,kCAAkC;AAClC,oBAAY,aAAa;IACvB,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,yCAAyC;AACzC,oBAAY,iBAAiB;IAC3B,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,GAAG,IAAI;CACR;AAED,qCAAqC;AACrC,oBAAY,qBAAqB;IAC/B,MAAM,IAAI;IACV,OAAO,IAAI;CACZ;AAED,2CAA2C;AAC3C,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,sCAAsC;AACtC,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED,qFAAqF;AACrF,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED,kDAAkD;AAClD,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Approval/lifecycle status of a game, category, or other core entity. */
|
|
2
|
+
export var CoreStatus;
|
|
3
|
+
(function (CoreStatus) {
|
|
4
|
+
CoreStatus[CoreStatus["Draft"] = 1] = "Draft";
|
|
5
|
+
CoreStatus[CoreStatus["Test"] = 2] = "Test";
|
|
6
|
+
CoreStatus[CoreStatus["PendingReview"] = 3] = "PendingReview";
|
|
7
|
+
CoreStatus[CoreStatus["Rejected"] = 4] = "Rejected";
|
|
8
|
+
CoreStatus[CoreStatus["Approved"] = 5] = "Approved";
|
|
9
|
+
CoreStatus[CoreStatus["Live"] = 6] = "Live";
|
|
10
|
+
})(CoreStatus || (CoreStatus = {}));
|
|
11
|
+
/** Visibility of a game's API. */
|
|
12
|
+
export var CoreApiStatus;
|
|
13
|
+
(function (CoreApiStatus) {
|
|
14
|
+
CoreApiStatus[CoreApiStatus["Private"] = 1] = "Private";
|
|
15
|
+
CoreApiStatus[CoreApiStatus["Public"] = 2] = "Public";
|
|
16
|
+
})(CoreApiStatus || (CoreApiStatus = {}));
|
|
17
|
+
/** Approval status of a game version. */
|
|
18
|
+
export var GameVersionStatus;
|
|
19
|
+
(function (GameVersionStatus) {
|
|
20
|
+
GameVersionStatus[GameVersionStatus["Approved"] = 1] = "Approved";
|
|
21
|
+
GameVersionStatus[GameVersionStatus["Deleted"] = 2] = "Deleted";
|
|
22
|
+
GameVersionStatus[GameVersionStatus["New"] = 3] = "New";
|
|
23
|
+
})(GameVersionStatus || (GameVersionStatus = {}));
|
|
24
|
+
/** Status of a game version type. */
|
|
25
|
+
export var GameVersionTypeStatus;
|
|
26
|
+
(function (GameVersionTypeStatus) {
|
|
27
|
+
GameVersionTypeStatus[GameVersionTypeStatus["Normal"] = 1] = "Normal";
|
|
28
|
+
GameVersionTypeStatus[GameVersionTypeStatus["Deleted"] = 2] = "Deleted";
|
|
29
|
+
})(GameVersionTypeStatus || (GameVersionTypeStatus = {}));
|
|
30
|
+
//# sourceMappingURL=games.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"games.js","sourceRoot":"","sources":["../../src/types/games.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,6CAAS,CAAA;IACT,2CAAQ,CAAA;IACR,6DAAiB,CAAA;IACjB,mDAAY,CAAA;IACZ,mDAAY,CAAA;IACZ,2CAAQ,CAAA;AACV,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB;AAED,kCAAkC;AAClC,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,uDAAW,CAAA;IACX,qDAAU,CAAA;AACZ,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,yCAAyC;AACzC,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,iEAAY,CAAA;IACZ,+DAAW,CAAA;IACX,uDAAO,CAAA;AACT,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED,qCAAqC;AACrC,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,qEAAU,CAAA;IACV,uEAAW,CAAA;AACb,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC"}
|