@mondarth/fvtt-package-catalogue-contract 0.3.2 → 0.4.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/api.d.ts +27 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +30 -2
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/v2.d.ts +755 -0
- package/dist/v2.d.ts.map +1 -0
- package/dist/v2.js +194 -0
- package/dist/v2.js.map +1 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -340,6 +340,22 @@ export declare const UniverseResponse: z.ZodObject<{
|
|
|
340
340
|
asOf: z.ZodNullable<z.ZodISODateTime>;
|
|
341
341
|
}, z.core.$strip>;
|
|
342
342
|
export type UniverseResponse = z.infer<typeof UniverseResponse>;
|
|
343
|
+
/**
|
|
344
|
+
* How what the catalogue holds compares with Foundry VTT's index, as the catalogue last checked, once a day. Each count
|
|
345
|
+
* but the first two is of something to put right; the catalogue queues the packages concerned to be crawled again.
|
|
346
|
+
*/
|
|
347
|
+
export declare const ConsistencyReport: z.ZodObject<{
|
|
348
|
+
at: z.ZodISODateTime;
|
|
349
|
+
listed: z.ZodInt;
|
|
350
|
+
held: z.ZodInt;
|
|
351
|
+
versionsMissing: z.ZodInt;
|
|
352
|
+
latestMissing: z.ZodInt;
|
|
353
|
+
listingsDiffer: z.ZodInt;
|
|
354
|
+
archivedHeld: z.ZodInt;
|
|
355
|
+
ownMissing: z.ZodInt;
|
|
356
|
+
requeued: z.ZodInt;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
export type ConsistencyReport = z.infer<typeof ConsistencyReport>;
|
|
343
359
|
/** `GET /api/v1/status`: what the catalogue holds. */
|
|
344
360
|
export declare const StatusResponse: z.ZodObject<{
|
|
345
361
|
apiVersion: z.ZodLiteral<"v1">;
|
|
@@ -347,6 +363,17 @@ export declare const StatusResponse: z.ZodObject<{
|
|
|
347
363
|
packages: z.ZodInt;
|
|
348
364
|
releases: z.ZodInt;
|
|
349
365
|
asOf: z.ZodNullable<z.ZodISODateTime>;
|
|
366
|
+
consistency: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
367
|
+
at: z.ZodISODateTime;
|
|
368
|
+
listed: z.ZodInt;
|
|
369
|
+
held: z.ZodInt;
|
|
370
|
+
versionsMissing: z.ZodInt;
|
|
371
|
+
latestMissing: z.ZodInt;
|
|
372
|
+
listingsDiffer: z.ZodInt;
|
|
373
|
+
archivedHeld: z.ZodInt;
|
|
374
|
+
ownMissing: z.ZodInt;
|
|
375
|
+
requeued: z.ZodInt;
|
|
376
|
+
}, z.core.$strip>>>;
|
|
350
377
|
}, z.core.$strip>;
|
|
351
378
|
export type StatusResponse = z.infer<typeof StatusResponse>;
|
|
352
379
|
/** `GET /healthz`: the server is up. It is not under {@link API_BASE}, and needs no key. */
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,yEAAyE;AACzE,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,YAAwB,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C,2FAA2F;AAC3F,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,UAAU,GAAG,MAAM,CAE7D;AAED,4EAA4E;AAC5E,eAAO,MAAM,aAAa,qBAAyB,CAAC;AAEpD;;;;GAIG;AACH,eAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiB3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAKhE;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;iBAmB5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,sDAAsD;AACtD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;iBASzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,4FAA4F;AAC5F,eAAO,MAAM,cAAc;;iBAEzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,4BAA4B;AAC5B,eAAO,MAAM,SAAS;;;;;;;;EAQpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,wCAAwC;AACxC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;iBAOxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/api.js
CHANGED
|
@@ -79,14 +79,42 @@ export const UniverseResponse = z.object({
|
|
|
79
79
|
/** The oldest time any of the packages held was brought up to date. */
|
|
80
80
|
asOf: AsOf,
|
|
81
81
|
});
|
|
82
|
+
/** A count of none or more. */
|
|
83
|
+
const Count = z.int().nonnegative();
|
|
84
|
+
/**
|
|
85
|
+
* How what the catalogue holds compares with Foundry VTT's index, as the catalogue last checked, once a day. Each count
|
|
86
|
+
* but the first two is of something to put right; the catalogue queues the packages concerned to be crawled again.
|
|
87
|
+
*/
|
|
88
|
+
export const ConsistencyReport = z.object({
|
|
89
|
+
/** When it was checked. */
|
|
90
|
+
at: z.iso.datetime(),
|
|
91
|
+
/** The packages the index lists, and has not archived. */
|
|
92
|
+
listed: Count,
|
|
93
|
+
/** Of those, the packages the catalogue holds. */
|
|
94
|
+
held: Count,
|
|
95
|
+
/** Versions the index lists of a package held that the catalogue does not hold. */
|
|
96
|
+
versionsMissing: Count,
|
|
97
|
+
/** Packages held whose newest version, where the index gives it, the catalogue does not hold. */
|
|
98
|
+
latestMissing: Count,
|
|
99
|
+
/** Releases held whose core compatibility, as the index lists it, is not what the catalogue holds. */
|
|
100
|
+
listingsDiffer: Count,
|
|
101
|
+
/** Packages the index has archived that the catalogue holds as available. */
|
|
102
|
+
archivedHeld: Count,
|
|
103
|
+
/** Packages whose own manifest last gave a version the catalogue does not hold. */
|
|
104
|
+
ownMissing: Count,
|
|
105
|
+
/** The packages queued to be crawled again for these. */
|
|
106
|
+
requeued: Count,
|
|
107
|
+
});
|
|
82
108
|
/** `GET /api/v1/status`: what the catalogue holds. */
|
|
83
109
|
export const StatusResponse = z.object({
|
|
84
110
|
apiVersion: z.literal(API_VERSION),
|
|
85
111
|
/** The catalogue's own release. */
|
|
86
112
|
version: z.string(),
|
|
87
|
-
packages:
|
|
88
|
-
releases:
|
|
113
|
+
packages: Count,
|
|
114
|
+
releases: Count,
|
|
89
115
|
asOf: AsOf,
|
|
116
|
+
/** How it last compared with Foundry VTT's index; null if it never has, or predates the check. */
|
|
117
|
+
consistency: ConsistencyReport.nullable().default(null),
|
|
90
118
|
});
|
|
91
119
|
/** `GET /healthz`: the server is up. It is not under {@link API_BASE}, and needs no key. */
|
|
92
120
|
export const HealthResponse = z.object({
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;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AAU,EAAE,KAAK;IACjB,yDAAyD;IACzD,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC;AAGH,sDAAsD;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAClC,mCAAmC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,IAAI;IACV,kGAAkG;IAClG,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CACxD,CAAC,CAAC;AAGH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;CACxB,CAAC,CAAC;AAGH,4BAA4B;AAC5B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9B,aAAa;IACb,cAAc;IACd,WAAW;IACX,oBAAoB;IACpB,cAAc;IACd,aAAa;IACb,UAAU;CACX,CAAC,CAAC;AAGH,wCAAwC;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,mDAAmD;QACnD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE;KACtC,CAAC;CACH,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export { PackageId, PackageRef, PackageType, packageKey } from './package.js';
|
|
|
9
9
|
export { Compatibility, Relationship, Relationships, Release, ReleaseDetail, Version } from './release.js';
|
|
10
10
|
export { CoreChannel, CoreRelease } from './core.js';
|
|
11
11
|
export { SourceGap, Universe } from './universe.js';
|
|
12
|
-
export { API_BASE, API_KEY_HEADER, API_VERSION, CLIENT_HEADER, ErrorCode, ErrorResponse, HealthResponse, MAX_UNIVERSE_PACKAGES, ReleasesResponse, StatusResponse, UNIVERSE_PATH, UnavailablePackage, UnavailableReason, UniverseRequest, UniverseResponse, releasesPath, } from './api.js';
|
|
12
|
+
export { API_BASE, API_KEY_HEADER, API_VERSION, CLIENT_HEADER, ConsistencyReport, ErrorCode, ErrorResponse, HealthResponse, MAX_UNIVERSE_PACKAGES, ReleasesResponse, StatusResponse, UNIVERSE_PATH, UnavailablePackage, UnavailableReason, UniverseRequest, UniverseResponse, releasesPath, } from './api.js';
|
|
13
|
+
export { API_V2_BASE, API_V2_VERSION, CORE_PATH, CoreResponse, LISTING_PATH, ListedPackage, ListedVersion, ListingResponse, LOOKUP_PATH, LookupPackage, LookupPackageRequest, LookupRequest, LookupResponse, OwnManifest, PackageRelease, PendingPackage, MANIFEST_PATH, MAX_RECHECK_PACKAGES, ManifestRequest, ManifestResponse, RECHECK_MIN_SECONDS, RECHECK_PATH, RecheckRequest, RecheckResponse, RecheckedPackage, } from './v2.js';
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,SAAS,EACT,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,5 +9,6 @@ export { PackageId, PackageRef, PackageType, packageKey } from './package.js';
|
|
|
9
9
|
export { Compatibility, Relationship, Relationships, Release, ReleaseDetail, Version } from './release.js';
|
|
10
10
|
export { CoreChannel, CoreRelease } from './core.js';
|
|
11
11
|
export { SourceGap, Universe } from './universe.js';
|
|
12
|
-
export { API_BASE, API_KEY_HEADER, API_VERSION, CLIENT_HEADER, ErrorCode, ErrorResponse, HealthResponse, MAX_UNIVERSE_PACKAGES, ReleasesResponse, StatusResponse, UNIVERSE_PATH, UnavailablePackage, UnavailableReason, UniverseRequest, UniverseResponse, releasesPath, } from './api.js';
|
|
12
|
+
export { API_BASE, API_KEY_HEADER, API_VERSION, CLIENT_HEADER, ConsistencyReport, ErrorCode, ErrorResponse, HealthResponse, MAX_UNIVERSE_PACKAGES, ReleasesResponse, StatusResponse, UNIVERSE_PATH, UnavailablePackage, UnavailableReason, UniverseRequest, UniverseResponse, releasesPath, } from './api.js';
|
|
13
|
+
export { API_V2_BASE, API_V2_VERSION, CORE_PATH, CoreResponse, LISTING_PATH, ListedPackage, ListedVersion, ListingResponse, LOOKUP_PATH, LookupPackage, LookupPackageRequest, LookupRequest, LookupResponse, OwnManifest, PackageRelease, PendingPackage, MANIFEST_PATH, MAX_RECHECK_PACKAGES, ManifestRequest, ManifestResponse, RECHECK_MIN_SECONDS, RECHECK_PATH, RecheckRequest, RecheckResponse, RecheckedPackage, } from './v2.js';
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,SAAS,EACT,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
package/dist/v2.d.ts
ADDED
|
@@ -0,0 +1,755 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version 2 of the HTTP API: answers shaped for clients that ask the catalogue alone, such as EMMA, as few times as
|
|
3
|
+
* they can. Version 1 is kept until every Mondarth client asks version 2.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/** The version of the API these schemas describe; part of every path. */
|
|
7
|
+
export declare const API_V2_VERSION = "v2";
|
|
8
|
+
/** The path every endpoint of version 2 is under. */
|
|
9
|
+
export declare const API_V2_BASE = "/api/v2";
|
|
10
|
+
/** The path of a lookup: a set of packages, everything they need, and how fresh each is. */
|
|
11
|
+
export declare const LOOKUP_PATH = "/api/v2/lookup";
|
|
12
|
+
/** The path of Foundry VTT's listing, as the catalogue keeps it: every package it offers to install. */
|
|
13
|
+
export declare const LISTING_PATH = "/api/v2/listing";
|
|
14
|
+
/** The path of Foundry VTT's builds. */
|
|
15
|
+
export declare const CORE_PATH = "/api/v2/core";
|
|
16
|
+
/** The path that reads a manifest URL a user gives, to install a package from. */
|
|
17
|
+
export declare const MANIFEST_PATH = "/api/v2/manifest";
|
|
18
|
+
/** The path that has packages' own manifests checked again now, as a client's "check live" asks. */
|
|
19
|
+
export declare const RECHECK_PATH = "/api/v2/recheck";
|
|
20
|
+
/** The most packages one recheck may ask for: those a user means to see fresh, not every package installed. */
|
|
21
|
+
export declare const MAX_RECHECK_PACKAGES = 50;
|
|
22
|
+
/**
|
|
23
|
+
* How long after a package's own manifest was last checked it may be checked again, in seconds: one checked since is
|
|
24
|
+
* given as it was, however many clients ask.
|
|
25
|
+
*/
|
|
26
|
+
export declare const RECHECK_MIN_SECONDS = 300;
|
|
27
|
+
/** A package to look up, with what the client knows of it. */
|
|
28
|
+
export declare const LookupPackageRequest: z.ZodObject<{
|
|
29
|
+
type: z.ZodEnum<{
|
|
30
|
+
module: "module";
|
|
31
|
+
system: "system";
|
|
32
|
+
world: "world";
|
|
33
|
+
}>;
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
installed: z.ZodExactOptional<z.ZodString>;
|
|
36
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type LookupPackageRequest = z.infer<typeof LookupPackageRequest>;
|
|
39
|
+
/** `POST /api/v2/lookup`: the packages to start from, such as those installed. */
|
|
40
|
+
export declare const LookupRequest: z.ZodObject<{
|
|
41
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
42
|
+
type: z.ZodEnum<{
|
|
43
|
+
module: "module";
|
|
44
|
+
system: "system";
|
|
45
|
+
world: "world";
|
|
46
|
+
}>;
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
installed: z.ZodExactOptional<z.ZodString>;
|
|
49
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
fromGeneration: z.ZodExactOptional<z.ZodInt>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type LookupRequest = z.infer<typeof LookupRequest>;
|
|
54
|
+
/** A release of a package given with its package: the package is not given again. */
|
|
55
|
+
export declare const PackageRelease: z.ZodObject<{
|
|
56
|
+
version: z.ZodString;
|
|
57
|
+
compatibility: z.ZodObject<{
|
|
58
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
59
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
60
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
relationships: z.ZodObject<{
|
|
63
|
+
requires: z.ZodArray<z.ZodObject<{
|
|
64
|
+
package: z.ZodObject<{
|
|
65
|
+
type: z.ZodEnum<{
|
|
66
|
+
module: "module";
|
|
67
|
+
system: "system";
|
|
68
|
+
world: "world";
|
|
69
|
+
}>;
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
compatibility: z.ZodObject<{
|
|
73
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
74
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
75
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
78
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
systems: z.ZodArray<z.ZodObject<{
|
|
81
|
+
package: z.ZodObject<{
|
|
82
|
+
type: z.ZodEnum<{
|
|
83
|
+
module: "module";
|
|
84
|
+
system: "system";
|
|
85
|
+
world: "world";
|
|
86
|
+
}>;
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
compatibility: z.ZodObject<{
|
|
90
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
91
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
92
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
95
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>>;
|
|
97
|
+
conflicts: z.ZodArray<z.ZodObject<{
|
|
98
|
+
package: z.ZodObject<{
|
|
99
|
+
type: z.ZodEnum<{
|
|
100
|
+
module: "module";
|
|
101
|
+
system: "system";
|
|
102
|
+
world: "world";
|
|
103
|
+
}>;
|
|
104
|
+
id: z.ZodString;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
compatibility: z.ZodObject<{
|
|
107
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
108
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
109
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
112
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
recommends: z.ZodArray<z.ZodObject<{
|
|
115
|
+
package: z.ZodObject<{
|
|
116
|
+
type: z.ZodEnum<{
|
|
117
|
+
module: "module";
|
|
118
|
+
system: "system";
|
|
119
|
+
world: "world";
|
|
120
|
+
}>;
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
compatibility: z.ZodObject<{
|
|
124
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
125
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
126
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
129
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$strip>>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
133
|
+
download: z.ZodExactOptional<z.ZodURL>;
|
|
134
|
+
versionManifest: z.ZodExactOptional<z.ZodURL>;
|
|
135
|
+
protected: z.ZodBoolean;
|
|
136
|
+
origin: z.ZodString;
|
|
137
|
+
detail: z.ZodEnum<{
|
|
138
|
+
listed: "listed";
|
|
139
|
+
loaded: "loaded";
|
|
140
|
+
}>;
|
|
141
|
+
listing: z.ZodExactOptional<z.ZodObject<{
|
|
142
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
143
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
144
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
unlisted: z.ZodExactOptional<z.ZodBoolean>;
|
|
147
|
+
loadFailed: z.ZodExactOptional<z.ZodBoolean>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
export type PackageRelease = z.infer<typeof PackageRelease>;
|
|
150
|
+
/**
|
|
151
|
+
* What the catalogue last found in a package's own manifest, as Foundry VTT's updater reads it: the version it gave,
|
|
152
|
+
* when it was last read, and when it was last tried. A client that wants it fresher asks for it to be checked again.
|
|
153
|
+
*/
|
|
154
|
+
export declare const OwnManifest: z.ZodObject<{
|
|
155
|
+
version: z.ZodNullable<z.ZodString>;
|
|
156
|
+
readAt: z.ZodNullable<z.ZodISODateTime>;
|
|
157
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export type OwnManifest = z.infer<typeof OwnManifest>;
|
|
160
|
+
/** A package looked up, or needed by one, with its releases and how fresh they are. */
|
|
161
|
+
export declare const LookupPackage: z.ZodObject<{
|
|
162
|
+
package: z.ZodObject<{
|
|
163
|
+
type: z.ZodEnum<{
|
|
164
|
+
module: "module";
|
|
165
|
+
system: "system";
|
|
166
|
+
world: "world";
|
|
167
|
+
}>;
|
|
168
|
+
id: z.ZodString;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
title: z.ZodNullable<z.ZodString>;
|
|
171
|
+
latest: z.ZodNullable<z.ZodString>;
|
|
172
|
+
premium: z.ZodBoolean;
|
|
173
|
+
syncedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
174
|
+
own: z.ZodObject<{
|
|
175
|
+
version: z.ZodNullable<z.ZodString>;
|
|
176
|
+
readAt: z.ZodNullable<z.ZodISODateTime>;
|
|
177
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
releases: z.ZodArray<z.ZodObject<{
|
|
180
|
+
version: z.ZodString;
|
|
181
|
+
compatibility: z.ZodObject<{
|
|
182
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
183
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
184
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
relationships: z.ZodObject<{
|
|
187
|
+
requires: z.ZodArray<z.ZodObject<{
|
|
188
|
+
package: z.ZodObject<{
|
|
189
|
+
type: z.ZodEnum<{
|
|
190
|
+
module: "module";
|
|
191
|
+
system: "system";
|
|
192
|
+
world: "world";
|
|
193
|
+
}>;
|
|
194
|
+
id: z.ZodString;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
compatibility: z.ZodObject<{
|
|
197
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
198
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
199
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
202
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
systems: z.ZodArray<z.ZodObject<{
|
|
205
|
+
package: z.ZodObject<{
|
|
206
|
+
type: z.ZodEnum<{
|
|
207
|
+
module: "module";
|
|
208
|
+
system: "system";
|
|
209
|
+
world: "world";
|
|
210
|
+
}>;
|
|
211
|
+
id: z.ZodString;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
compatibility: z.ZodObject<{
|
|
214
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
215
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
216
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
219
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
conflicts: z.ZodArray<z.ZodObject<{
|
|
222
|
+
package: z.ZodObject<{
|
|
223
|
+
type: z.ZodEnum<{
|
|
224
|
+
module: "module";
|
|
225
|
+
system: "system";
|
|
226
|
+
world: "world";
|
|
227
|
+
}>;
|
|
228
|
+
id: z.ZodString;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
compatibility: z.ZodObject<{
|
|
231
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
232
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
233
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
236
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
recommends: z.ZodArray<z.ZodObject<{
|
|
239
|
+
package: z.ZodObject<{
|
|
240
|
+
type: z.ZodEnum<{
|
|
241
|
+
module: "module";
|
|
242
|
+
system: "system";
|
|
243
|
+
world: "world";
|
|
244
|
+
}>;
|
|
245
|
+
id: z.ZodString;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
compatibility: z.ZodObject<{
|
|
248
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
249
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
250
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
253
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
254
|
+
}, z.core.$strip>>;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
257
|
+
download: z.ZodExactOptional<z.ZodURL>;
|
|
258
|
+
versionManifest: z.ZodExactOptional<z.ZodURL>;
|
|
259
|
+
protected: z.ZodBoolean;
|
|
260
|
+
origin: z.ZodString;
|
|
261
|
+
detail: z.ZodEnum<{
|
|
262
|
+
listed: "listed";
|
|
263
|
+
loaded: "loaded";
|
|
264
|
+
}>;
|
|
265
|
+
listing: z.ZodExactOptional<z.ZodObject<{
|
|
266
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
267
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
268
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
269
|
+
}, z.core.$strip>>;
|
|
270
|
+
unlisted: z.ZodExactOptional<z.ZodBoolean>;
|
|
271
|
+
loadFailed: z.ZodExactOptional<z.ZodBoolean>;
|
|
272
|
+
}, z.core.$strip>>;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
export type LookupPackage = z.infer<typeof LookupPackage>;
|
|
275
|
+
/** A package the catalogue does not hold yet, queued for it to fetch, and when to ask again. */
|
|
276
|
+
export declare const PendingPackage: z.ZodObject<{
|
|
277
|
+
package: z.ZodObject<{
|
|
278
|
+
type: z.ZodEnum<{
|
|
279
|
+
module: "module";
|
|
280
|
+
system: "system";
|
|
281
|
+
world: "world";
|
|
282
|
+
}>;
|
|
283
|
+
id: z.ZodString;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
retryAfter: z.ZodInt;
|
|
286
|
+
}, z.core.$strip>;
|
|
287
|
+
export type PendingPackage = z.infer<typeof PendingPackage>;
|
|
288
|
+
/**
|
|
289
|
+
* `POST /api/v2/lookup`: the packages asked for and every package their releases require or run in, each once, with its
|
|
290
|
+
* releases, as far as the catalogue holds them; with Foundry VTT's builds.
|
|
291
|
+
*/
|
|
292
|
+
export declare const LookupResponse: z.ZodObject<{
|
|
293
|
+
core: z.ZodArray<z.ZodObject<{
|
|
294
|
+
version: z.ZodString;
|
|
295
|
+
generation: z.ZodInt;
|
|
296
|
+
channel: z.ZodEnum<{
|
|
297
|
+
development: "development";
|
|
298
|
+
prototype: "prototype";
|
|
299
|
+
stable: "stable";
|
|
300
|
+
testing: "testing";
|
|
301
|
+
}>;
|
|
302
|
+
}, z.core.$strip>>;
|
|
303
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
304
|
+
package: z.ZodObject<{
|
|
305
|
+
type: z.ZodEnum<{
|
|
306
|
+
module: "module";
|
|
307
|
+
system: "system";
|
|
308
|
+
world: "world";
|
|
309
|
+
}>;
|
|
310
|
+
id: z.ZodString;
|
|
311
|
+
}, z.core.$strip>;
|
|
312
|
+
title: z.ZodNullable<z.ZodString>;
|
|
313
|
+
latest: z.ZodNullable<z.ZodString>;
|
|
314
|
+
premium: z.ZodBoolean;
|
|
315
|
+
syncedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
316
|
+
own: z.ZodObject<{
|
|
317
|
+
version: z.ZodNullable<z.ZodString>;
|
|
318
|
+
readAt: z.ZodNullable<z.ZodISODateTime>;
|
|
319
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
releases: z.ZodArray<z.ZodObject<{
|
|
322
|
+
version: z.ZodString;
|
|
323
|
+
compatibility: z.ZodObject<{
|
|
324
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
325
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
326
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
relationships: z.ZodObject<{
|
|
329
|
+
requires: z.ZodArray<z.ZodObject<{
|
|
330
|
+
package: z.ZodObject<{
|
|
331
|
+
type: z.ZodEnum<{
|
|
332
|
+
module: "module";
|
|
333
|
+
system: "system";
|
|
334
|
+
world: "world";
|
|
335
|
+
}>;
|
|
336
|
+
id: z.ZodString;
|
|
337
|
+
}, z.core.$strip>;
|
|
338
|
+
compatibility: z.ZodObject<{
|
|
339
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
340
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
341
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
342
|
+
}, z.core.$strip>;
|
|
343
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
344
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
345
|
+
}, z.core.$strip>>;
|
|
346
|
+
systems: z.ZodArray<z.ZodObject<{
|
|
347
|
+
package: z.ZodObject<{
|
|
348
|
+
type: z.ZodEnum<{
|
|
349
|
+
module: "module";
|
|
350
|
+
system: "system";
|
|
351
|
+
world: "world";
|
|
352
|
+
}>;
|
|
353
|
+
id: z.ZodString;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
compatibility: z.ZodObject<{
|
|
356
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
357
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
358
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
359
|
+
}, z.core.$strip>;
|
|
360
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
361
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
362
|
+
}, z.core.$strip>>;
|
|
363
|
+
conflicts: z.ZodArray<z.ZodObject<{
|
|
364
|
+
package: z.ZodObject<{
|
|
365
|
+
type: z.ZodEnum<{
|
|
366
|
+
module: "module";
|
|
367
|
+
system: "system";
|
|
368
|
+
world: "world";
|
|
369
|
+
}>;
|
|
370
|
+
id: z.ZodString;
|
|
371
|
+
}, z.core.$strip>;
|
|
372
|
+
compatibility: z.ZodObject<{
|
|
373
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
374
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
375
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
378
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
379
|
+
}, z.core.$strip>>;
|
|
380
|
+
recommends: z.ZodArray<z.ZodObject<{
|
|
381
|
+
package: z.ZodObject<{
|
|
382
|
+
type: z.ZodEnum<{
|
|
383
|
+
module: "module";
|
|
384
|
+
system: "system";
|
|
385
|
+
world: "world";
|
|
386
|
+
}>;
|
|
387
|
+
id: z.ZodString;
|
|
388
|
+
}, z.core.$strip>;
|
|
389
|
+
compatibility: z.ZodObject<{
|
|
390
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
391
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
392
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
395
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
396
|
+
}, z.core.$strip>>;
|
|
397
|
+
}, z.core.$strip>;
|
|
398
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
399
|
+
download: z.ZodExactOptional<z.ZodURL>;
|
|
400
|
+
versionManifest: z.ZodExactOptional<z.ZodURL>;
|
|
401
|
+
protected: z.ZodBoolean;
|
|
402
|
+
origin: z.ZodString;
|
|
403
|
+
detail: z.ZodEnum<{
|
|
404
|
+
listed: "listed";
|
|
405
|
+
loaded: "loaded";
|
|
406
|
+
}>;
|
|
407
|
+
listing: z.ZodExactOptional<z.ZodObject<{
|
|
408
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
409
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
410
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
411
|
+
}, z.core.$strip>>;
|
|
412
|
+
unlisted: z.ZodExactOptional<z.ZodBoolean>;
|
|
413
|
+
loadFailed: z.ZodExactOptional<z.ZodBoolean>;
|
|
414
|
+
}, z.core.$strip>>;
|
|
415
|
+
}, z.core.$strip>>;
|
|
416
|
+
pending: z.ZodArray<z.ZodObject<{
|
|
417
|
+
package: z.ZodObject<{
|
|
418
|
+
type: z.ZodEnum<{
|
|
419
|
+
module: "module";
|
|
420
|
+
system: "system";
|
|
421
|
+
world: "world";
|
|
422
|
+
}>;
|
|
423
|
+
id: z.ZodString;
|
|
424
|
+
}, z.core.$strip>;
|
|
425
|
+
retryAfter: z.ZodInt;
|
|
426
|
+
}, z.core.$strip>>;
|
|
427
|
+
unavailable: z.ZodArray<z.ZodObject<{
|
|
428
|
+
package: z.ZodObject<{
|
|
429
|
+
type: z.ZodEnum<{
|
|
430
|
+
module: "module";
|
|
431
|
+
system: "system";
|
|
432
|
+
world: "world";
|
|
433
|
+
}>;
|
|
434
|
+
id: z.ZodString;
|
|
435
|
+
}, z.core.$strip>;
|
|
436
|
+
reason: z.ZodEnum<{
|
|
437
|
+
archived: "archived";
|
|
438
|
+
gone: "gone";
|
|
439
|
+
}>;
|
|
440
|
+
note: z.ZodExactOptional<z.ZodString>;
|
|
441
|
+
}, z.core.$strip>>;
|
|
442
|
+
unreached: z.ZodArray<z.ZodObject<{
|
|
443
|
+
type: z.ZodEnum<{
|
|
444
|
+
module: "module";
|
|
445
|
+
system: "system";
|
|
446
|
+
world: "world";
|
|
447
|
+
}>;
|
|
448
|
+
id: z.ZodString;
|
|
449
|
+
}, z.core.$strip>>;
|
|
450
|
+
asOf: z.ZodNullable<z.ZodISODateTime>;
|
|
451
|
+
}, z.core.$strip>;
|
|
452
|
+
export type LookupResponse = z.infer<typeof LookupResponse>;
|
|
453
|
+
/** A version as Foundry VTT's listing lists it, the newest of a line of builds, with the builds it runs on. */
|
|
454
|
+
export declare const ListedVersion: z.ZodObject<{
|
|
455
|
+
version: z.ZodString;
|
|
456
|
+
minimum: z.ZodNullable<z.ZodString>;
|
|
457
|
+
maximum: z.ZodNullable<z.ZodString>;
|
|
458
|
+
verified: z.ZodNullable<z.ZodString>;
|
|
459
|
+
manifest: z.ZodNullable<z.ZodString>;
|
|
460
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
461
|
+
}, z.core.$strip>;
|
|
462
|
+
export type ListedVersion = z.infer<typeof ListedVersion>;
|
|
463
|
+
/** A package Foundry VTT's listing offers to install, as its Setup screen shows it. */
|
|
464
|
+
export declare const ListedPackage: z.ZodObject<{
|
|
465
|
+
package: z.ZodObject<{
|
|
466
|
+
type: z.ZodEnum<{
|
|
467
|
+
module: "module";
|
|
468
|
+
system: "system";
|
|
469
|
+
world: "world";
|
|
470
|
+
}>;
|
|
471
|
+
id: z.ZodString;
|
|
472
|
+
}, z.core.$strip>;
|
|
473
|
+
title: z.ZodString;
|
|
474
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
475
|
+
author: z.ZodNullable<z.ZodString>;
|
|
476
|
+
url: z.ZodNullable<z.ZodString>;
|
|
477
|
+
tags: z.ZodArray<z.ZodString>;
|
|
478
|
+
systems: z.ZodArray<z.ZodString>;
|
|
479
|
+
premium: z.ZodBoolean;
|
|
480
|
+
exclusive: z.ZodBoolean;
|
|
481
|
+
latest: z.ZodNullable<z.ZodString>;
|
|
482
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
483
|
+
version: z.ZodString;
|
|
484
|
+
minimum: z.ZodNullable<z.ZodString>;
|
|
485
|
+
maximum: z.ZodNullable<z.ZodString>;
|
|
486
|
+
verified: z.ZodNullable<z.ZodString>;
|
|
487
|
+
manifest: z.ZodNullable<z.ZodString>;
|
|
488
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
489
|
+
}, z.core.$strip>>;
|
|
490
|
+
}, z.core.$strip>;
|
|
491
|
+
export type ListedPackage = z.infer<typeof ListedPackage>;
|
|
492
|
+
/**
|
|
493
|
+
* `GET /api/v2/listing`, or `?type=module` or `?type=system` for one type: every package Foundry VTT's listing offers,
|
|
494
|
+
* neither archived nor delisted. The same for every client, so it is given with an `ETag`, and answered `304` while it
|
|
495
|
+
* has not changed.
|
|
496
|
+
*/
|
|
497
|
+
export declare const ListingResponse: z.ZodObject<{
|
|
498
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
499
|
+
package: z.ZodObject<{
|
|
500
|
+
type: z.ZodEnum<{
|
|
501
|
+
module: "module";
|
|
502
|
+
system: "system";
|
|
503
|
+
world: "world";
|
|
504
|
+
}>;
|
|
505
|
+
id: z.ZodString;
|
|
506
|
+
}, z.core.$strip>;
|
|
507
|
+
title: z.ZodString;
|
|
508
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
509
|
+
author: z.ZodNullable<z.ZodString>;
|
|
510
|
+
url: z.ZodNullable<z.ZodString>;
|
|
511
|
+
tags: z.ZodArray<z.ZodString>;
|
|
512
|
+
systems: z.ZodArray<z.ZodString>;
|
|
513
|
+
premium: z.ZodBoolean;
|
|
514
|
+
exclusive: z.ZodBoolean;
|
|
515
|
+
latest: z.ZodNullable<z.ZodString>;
|
|
516
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
517
|
+
version: z.ZodString;
|
|
518
|
+
minimum: z.ZodNullable<z.ZodString>;
|
|
519
|
+
maximum: z.ZodNullable<z.ZodString>;
|
|
520
|
+
verified: z.ZodNullable<z.ZodString>;
|
|
521
|
+
manifest: z.ZodNullable<z.ZodString>;
|
|
522
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
523
|
+
}, z.core.$strip>>;
|
|
524
|
+
}, z.core.$strip>>;
|
|
525
|
+
asOf: z.ZodNullable<z.ZodISODateTime>;
|
|
526
|
+
}, z.core.$strip>;
|
|
527
|
+
export type ListingResponse = z.infer<typeof ListingResponse>;
|
|
528
|
+
/** `GET /api/v2/core`: Foundry VTT's builds, oldest first, given with an `ETag` as the listing is. */
|
|
529
|
+
export declare const CoreResponse: z.ZodObject<{
|
|
530
|
+
core: z.ZodArray<z.ZodObject<{
|
|
531
|
+
version: z.ZodString;
|
|
532
|
+
generation: z.ZodInt;
|
|
533
|
+
channel: z.ZodEnum<{
|
|
534
|
+
development: "development";
|
|
535
|
+
prototype: "prototype";
|
|
536
|
+
stable: "stable";
|
|
537
|
+
testing: "testing";
|
|
538
|
+
}>;
|
|
539
|
+
}, z.core.$strip>>;
|
|
540
|
+
}, z.core.$strip>;
|
|
541
|
+
export type CoreResponse = z.infer<typeof CoreResponse>;
|
|
542
|
+
/** `POST /api/v2/recheck`: the packages whose own manifests to check again now. */
|
|
543
|
+
export declare const RecheckRequest: z.ZodObject<{
|
|
544
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
545
|
+
type: z.ZodEnum<{
|
|
546
|
+
module: "module";
|
|
547
|
+
system: "system";
|
|
548
|
+
world: "world";
|
|
549
|
+
}>;
|
|
550
|
+
id: z.ZodString;
|
|
551
|
+
}, z.core.$strip>>;
|
|
552
|
+
}, z.core.$strip>;
|
|
553
|
+
export type RecheckRequest = z.infer<typeof RecheckRequest>;
|
|
554
|
+
/** A package rechecked: what its own manifest gives now, and whether that is a version the catalogue does not hold. */
|
|
555
|
+
export declare const RecheckedPackage: z.ZodObject<{
|
|
556
|
+
package: z.ZodObject<{
|
|
557
|
+
type: z.ZodEnum<{
|
|
558
|
+
module: "module";
|
|
559
|
+
system: "system";
|
|
560
|
+
world: "world";
|
|
561
|
+
}>;
|
|
562
|
+
id: z.ZodString;
|
|
563
|
+
}, z.core.$strip>;
|
|
564
|
+
own: z.ZodObject<{
|
|
565
|
+
version: z.ZodNullable<z.ZodString>;
|
|
566
|
+
readAt: z.ZodNullable<z.ZodISODateTime>;
|
|
567
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
568
|
+
}, z.core.$strip>;
|
|
569
|
+
changed: z.ZodBoolean;
|
|
570
|
+
}, z.core.$strip>;
|
|
571
|
+
export type RecheckedPackage = z.infer<typeof RecheckedPackage>;
|
|
572
|
+
/**
|
|
573
|
+
* `POST /api/v2/recheck`: each package asked for that the catalogue holds, once, with what its own manifest gives now;
|
|
574
|
+
* one checked in the last {@link RECHECK_MIN_SECONDS} is given as it was then. A package not held is left out: look it
|
|
575
|
+
* up, and it is queued.
|
|
576
|
+
*/
|
|
577
|
+
export declare const RecheckResponse: z.ZodObject<{
|
|
578
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
579
|
+
package: z.ZodObject<{
|
|
580
|
+
type: z.ZodEnum<{
|
|
581
|
+
module: "module";
|
|
582
|
+
system: "system";
|
|
583
|
+
world: "world";
|
|
584
|
+
}>;
|
|
585
|
+
id: z.ZodString;
|
|
586
|
+
}, z.core.$strip>;
|
|
587
|
+
own: z.ZodObject<{
|
|
588
|
+
version: z.ZodNullable<z.ZodString>;
|
|
589
|
+
readAt: z.ZodNullable<z.ZodISODateTime>;
|
|
590
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
591
|
+
}, z.core.$strip>;
|
|
592
|
+
changed: z.ZodBoolean;
|
|
593
|
+
}, z.core.$strip>>;
|
|
594
|
+
pending: z.ZodArray<z.ZodObject<{
|
|
595
|
+
package: z.ZodObject<{
|
|
596
|
+
type: z.ZodEnum<{
|
|
597
|
+
module: "module";
|
|
598
|
+
system: "system";
|
|
599
|
+
world: "world";
|
|
600
|
+
}>;
|
|
601
|
+
id: z.ZodString;
|
|
602
|
+
}, z.core.$strip>;
|
|
603
|
+
retryAfter: z.ZodInt;
|
|
604
|
+
}, z.core.$strip>>;
|
|
605
|
+
}, z.core.$strip>;
|
|
606
|
+
export type RecheckResponse = z.infer<typeof RecheckResponse>;
|
|
607
|
+
/** `POST /api/v2/manifest`: a manifest URL a user gives, and the type of package they mean to install from it. */
|
|
608
|
+
export declare const ManifestRequest: z.ZodObject<{
|
|
609
|
+
url: z.ZodURL;
|
|
610
|
+
type: z.ZodEnum<{
|
|
611
|
+
module: "module";
|
|
612
|
+
system: "system";
|
|
613
|
+
}>;
|
|
614
|
+
}, z.core.$strip>;
|
|
615
|
+
export type ManifestRequest = z.infer<typeof ManifestRequest>;
|
|
616
|
+
/**
|
|
617
|
+
* `POST /api/v2/manifest`: the package the manifest describes, with its title, as a release whose manifest is the URL
|
|
618
|
+
* given, for its version alone, since what it gives is what the user chose; or why it is none. The catalogue queues
|
|
619
|
+
* the package, found by the URL, so that a lookup soon holds its other releases.
|
|
620
|
+
*
|
|
621
|
+
* - `unreadable`: it could not be had. `reason` is as a gap gives it, or `refused`, a URL that may not be fetched,
|
|
622
|
+
* such as one of a private address, or that redirects too often; or `too-large`.
|
|
623
|
+
* - `other-type`: it is a manifest of the other type of package, which Foundry VTT would install as the type asked.
|
|
624
|
+
* - `not-manifest`: what it gave is not a manifest.
|
|
625
|
+
*/
|
|
626
|
+
export declare const ManifestResponse: z.ZodUnion<readonly [z.ZodObject<{
|
|
627
|
+
ok: z.ZodLiteral<true>;
|
|
628
|
+
title: z.ZodString;
|
|
629
|
+
release: z.ZodObject<{
|
|
630
|
+
package: z.ZodObject<{
|
|
631
|
+
type: z.ZodEnum<{
|
|
632
|
+
module: "module";
|
|
633
|
+
system: "system";
|
|
634
|
+
world: "world";
|
|
635
|
+
}>;
|
|
636
|
+
id: z.ZodString;
|
|
637
|
+
}, z.core.$strip>;
|
|
638
|
+
version: z.ZodString;
|
|
639
|
+
compatibility: z.ZodObject<{
|
|
640
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
641
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
642
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
643
|
+
}, z.core.$strip>;
|
|
644
|
+
relationships: z.ZodObject<{
|
|
645
|
+
requires: z.ZodArray<z.ZodObject<{
|
|
646
|
+
package: z.ZodObject<{
|
|
647
|
+
type: z.ZodEnum<{
|
|
648
|
+
module: "module";
|
|
649
|
+
system: "system";
|
|
650
|
+
world: "world";
|
|
651
|
+
}>;
|
|
652
|
+
id: z.ZodString;
|
|
653
|
+
}, z.core.$strip>;
|
|
654
|
+
compatibility: z.ZodObject<{
|
|
655
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
656
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
657
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
658
|
+
}, z.core.$strip>;
|
|
659
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
660
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
661
|
+
}, z.core.$strip>>;
|
|
662
|
+
systems: z.ZodArray<z.ZodObject<{
|
|
663
|
+
package: z.ZodObject<{
|
|
664
|
+
type: z.ZodEnum<{
|
|
665
|
+
module: "module";
|
|
666
|
+
system: "system";
|
|
667
|
+
world: "world";
|
|
668
|
+
}>;
|
|
669
|
+
id: z.ZodString;
|
|
670
|
+
}, z.core.$strip>;
|
|
671
|
+
compatibility: z.ZodObject<{
|
|
672
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
673
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
674
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
675
|
+
}, z.core.$strip>;
|
|
676
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
677
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
678
|
+
}, z.core.$strip>>;
|
|
679
|
+
conflicts: z.ZodArray<z.ZodObject<{
|
|
680
|
+
package: z.ZodObject<{
|
|
681
|
+
type: z.ZodEnum<{
|
|
682
|
+
module: "module";
|
|
683
|
+
system: "system";
|
|
684
|
+
world: "world";
|
|
685
|
+
}>;
|
|
686
|
+
id: z.ZodString;
|
|
687
|
+
}, z.core.$strip>;
|
|
688
|
+
compatibility: z.ZodObject<{
|
|
689
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
690
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
691
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
692
|
+
}, z.core.$strip>;
|
|
693
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
694
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
695
|
+
}, z.core.$strip>>;
|
|
696
|
+
recommends: z.ZodArray<z.ZodObject<{
|
|
697
|
+
package: z.ZodObject<{
|
|
698
|
+
type: z.ZodEnum<{
|
|
699
|
+
module: "module";
|
|
700
|
+
system: "system";
|
|
701
|
+
world: "world";
|
|
702
|
+
}>;
|
|
703
|
+
id: z.ZodString;
|
|
704
|
+
}, z.core.$strip>;
|
|
705
|
+
compatibility: z.ZodObject<{
|
|
706
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
707
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
708
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
709
|
+
}, z.core.$strip>;
|
|
710
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
711
|
+
reason: z.ZodExactOptional<z.ZodString>;
|
|
712
|
+
}, z.core.$strip>>;
|
|
713
|
+
}, z.core.$strip>;
|
|
714
|
+
manifest: z.ZodExactOptional<z.ZodURL>;
|
|
715
|
+
download: z.ZodExactOptional<z.ZodURL>;
|
|
716
|
+
versionManifest: z.ZodExactOptional<z.ZodURL>;
|
|
717
|
+
protected: z.ZodBoolean;
|
|
718
|
+
origin: z.ZodString;
|
|
719
|
+
detail: z.ZodEnum<{
|
|
720
|
+
listed: "listed";
|
|
721
|
+
loaded: "loaded";
|
|
722
|
+
}>;
|
|
723
|
+
listing: z.ZodExactOptional<z.ZodObject<{
|
|
724
|
+
minimum: z.ZodExactOptional<z.ZodString>;
|
|
725
|
+
maximum: z.ZodExactOptional<z.ZodString>;
|
|
726
|
+
verified: z.ZodExactOptional<z.ZodString>;
|
|
727
|
+
}, z.core.$strip>>;
|
|
728
|
+
unlisted: z.ZodExactOptional<z.ZodBoolean>;
|
|
729
|
+
loadFailed: z.ZodExactOptional<z.ZodBoolean>;
|
|
730
|
+
}, z.core.$strip>;
|
|
731
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
732
|
+
ok: z.ZodLiteral<false>;
|
|
733
|
+
problem: z.ZodLiteral<"unreadable">;
|
|
734
|
+
reason: z.ZodEnum<{
|
|
735
|
+
http: "http";
|
|
736
|
+
invalid: "invalid";
|
|
737
|
+
network: "network";
|
|
738
|
+
refused: "refused";
|
|
739
|
+
"too-large": "too-large";
|
|
740
|
+
}>;
|
|
741
|
+
status: z.ZodExactOptional<z.ZodInt>;
|
|
742
|
+
host: z.ZodString;
|
|
743
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
744
|
+
ok: z.ZodLiteral<false>;
|
|
745
|
+
problem: z.ZodLiteral<"other-type">;
|
|
746
|
+
type: z.ZodEnum<{
|
|
747
|
+
module: "module";
|
|
748
|
+
system: "system";
|
|
749
|
+
}>;
|
|
750
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
751
|
+
ok: z.ZodLiteral<false>;
|
|
752
|
+
problem: z.ZodLiteral<"not-manifest">;
|
|
753
|
+
}, z.core.$strip>]>;
|
|
754
|
+
export type ManifestResponse = z.infer<typeof ManifestResponse>;
|
|
755
|
+
//# sourceMappingURL=v2.d.ts.map
|
package/dist/v2.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../src/v2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,yEAAyE;AACzE,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,qDAAqD;AACrD,eAAO,MAAM,WAAW,YAA2B,CAAC;AAEpD,4FAA4F;AAC5F,eAAO,MAAM,WAAW,mBAA0B,CAAC;AAEnD,wGAAwG;AACxG,eAAO,MAAM,YAAY,oBAA2B,CAAC;AAErD,wCAAwC;AACxC,eAAO,MAAM,SAAS,iBAAwB,CAAC;AAE/C,kFAAkF;AAClF,eAAO,MAAM,aAAa,qBAA4B,CAAC;AAEvD,oGAAoG;AACpG,eAAO,MAAM,YAAY,oBAA2B,CAAC;AAErD,+GAA+G;AAC/G,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAKvC,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB;;;;;;;;;iBAQ/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,kFAAkF;AAClF,eAAO,MAAM,aAAa;;;;;;;;;;;;iBAOxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,qFAAqF;AACrF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAkC,CAAC;AAC9D,M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1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version 2 of the HTTP API: answers shaped for clients that ask the catalogue alone, such as EMMA, as few times as
|
|
3
|
+
* they can. Version 1 is kept until every Mondarth client asks version 2.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { MAX_UNIVERSE_PACKAGES, UnavailablePackage } from './api.js';
|
|
7
|
+
import { CoreRelease } from './core.js';
|
|
8
|
+
import { PackageRef } from './package.js';
|
|
9
|
+
import { Release, Version } from './release.js';
|
|
10
|
+
/** The version of the API these schemas describe; part of every path. */
|
|
11
|
+
export const API_V2_VERSION = 'v2';
|
|
12
|
+
/** The path every endpoint of version 2 is under. */
|
|
13
|
+
export const API_V2_BASE = `/api/${API_V2_VERSION}`;
|
|
14
|
+
/** The path of a lookup: a set of packages, everything they need, and how fresh each is. */
|
|
15
|
+
export const LOOKUP_PATH = `${API_V2_BASE}/lookup`;
|
|
16
|
+
/** The path of Foundry VTT's listing, as the catalogue keeps it: every package it offers to install. */
|
|
17
|
+
export const LISTING_PATH = `${API_V2_BASE}/listing`;
|
|
18
|
+
/** The path of Foundry VTT's builds. */
|
|
19
|
+
export const CORE_PATH = `${API_V2_BASE}/core`;
|
|
20
|
+
/** The path that reads a manifest URL a user gives, to install a package from. */
|
|
21
|
+
export const MANIFEST_PATH = `${API_V2_BASE}/manifest`;
|
|
22
|
+
/** The path that has packages' own manifests checked again now, as a client's "check live" asks. */
|
|
23
|
+
export const RECHECK_PATH = `${API_V2_BASE}/recheck`;
|
|
24
|
+
/** The most packages one recheck may ask for: those a user means to see fresh, not every package installed. */
|
|
25
|
+
export const MAX_RECHECK_PACKAGES = 50;
|
|
26
|
+
/**
|
|
27
|
+
* How long after a package's own manifest was last checked it may be checked again, in seconds: one checked since is
|
|
28
|
+
* given as it was, however many clients ask.
|
|
29
|
+
*/
|
|
30
|
+
export const RECHECK_MIN_SECONDS = 300;
|
|
31
|
+
/** A time, as ISO 8601, or null for never. */
|
|
32
|
+
const Time = z.iso.datetime().nullable();
|
|
33
|
+
/** A package to look up, with what the client knows of it. */
|
|
34
|
+
export const LookupPackageRequest = PackageRef.extend({
|
|
35
|
+
/** The version installed, which is given whatever `fromGeneration` leaves out. */
|
|
36
|
+
installed: Version.exactOptional(),
|
|
37
|
+
/**
|
|
38
|
+
* The manifest URL it was installed from: a package the catalogue does not hold is found by it, as one installed
|
|
39
|
+
* from a manifest alone is found by nothing else.
|
|
40
|
+
*/
|
|
41
|
+
manifest: z.url().exactOptional(),
|
|
42
|
+
});
|
|
43
|
+
/** `POST /api/v2/lookup`: the packages to start from, such as those installed. */
|
|
44
|
+
export const LookupRequest = z.object({
|
|
45
|
+
packages: z.array(LookupPackageRequest).min(1).max(MAX_UNIVERSE_PACKAGES),
|
|
46
|
+
/**
|
|
47
|
+
* Only releases that may run on a build of this generation of Foundry VTT or a later one, by the `maximum` they
|
|
48
|
+
* declare, and the versions installed: what a client on that generation can choose from. Every release when left out.
|
|
49
|
+
*/
|
|
50
|
+
fromGeneration: z.int().positive().exactOptional(),
|
|
51
|
+
});
|
|
52
|
+
/** A release of a package given with its package: the package is not given again. */
|
|
53
|
+
export const PackageRelease = Release.omit({ package: true });
|
|
54
|
+
/**
|
|
55
|
+
* What the catalogue last found in a package's own manifest, as Foundry VTT's updater reads it: the version it gave,
|
|
56
|
+
* when it was last read, and when it was last tried. A client that wants it fresher asks for it to be checked again.
|
|
57
|
+
*/
|
|
58
|
+
export const OwnManifest = z.object({
|
|
59
|
+
version: Version.nullable(),
|
|
60
|
+
readAt: Time,
|
|
61
|
+
checkedAt: Time,
|
|
62
|
+
});
|
|
63
|
+
/** A package looked up, or needed by one, with its releases and how fresh they are. */
|
|
64
|
+
export const LookupPackage = z.object({
|
|
65
|
+
package: PackageRef,
|
|
66
|
+
/** Its title, as Foundry VTT's listing gives it; null if it is not listed. */
|
|
67
|
+
title: z.string().nullable(),
|
|
68
|
+
/** The newest version, where Foundry VTT's listing gives it, which it does for few packages. */
|
|
69
|
+
latest: Version.nullable(),
|
|
70
|
+
/** Premium content: installing it needs the user's licence. */
|
|
71
|
+
premium: z.boolean(),
|
|
72
|
+
/** When its releases were last brought up to date. */
|
|
73
|
+
syncedAt: Time,
|
|
74
|
+
own: OwnManifest,
|
|
75
|
+
releases: z.array(PackageRelease),
|
|
76
|
+
});
|
|
77
|
+
/** A package the catalogue does not hold yet, queued for it to fetch, and when to ask again. */
|
|
78
|
+
export const PendingPackage = z.object({
|
|
79
|
+
package: PackageRef,
|
|
80
|
+
/** Seconds after which asking again may find it. */
|
|
81
|
+
retryAfter: z.int().positive(),
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* `POST /api/v2/lookup`: the packages asked for and every package their releases require or run in, each once, with its
|
|
85
|
+
* releases, as far as the catalogue holds them; with Foundry VTT's builds.
|
|
86
|
+
*/
|
|
87
|
+
export const LookupResponse = z.object({
|
|
88
|
+
core: z.array(CoreRelease),
|
|
89
|
+
packages: z.array(LookupPackage),
|
|
90
|
+
/** Packages asked for or needed that the catalogue does not hold yet. */
|
|
91
|
+
pending: z.array(PendingPackage),
|
|
92
|
+
/** Packages asked for or needed that cannot be had, with no releases, and not followed further. */
|
|
93
|
+
unavailable: z.array(UnavailablePackage),
|
|
94
|
+
/**
|
|
95
|
+
* Packages held whose sources could not all be listed when they were last brought up to date, so may have newer
|
|
96
|
+
* versions the catalogue does not hold.
|
|
97
|
+
*/
|
|
98
|
+
unreached: z.array(PackageRef),
|
|
99
|
+
/** The oldest time any of the packages held was brought up to date. */
|
|
100
|
+
asOf: Time,
|
|
101
|
+
});
|
|
102
|
+
/** A version as Foundry VTT's listing lists it, the newest of a line of builds, with the builds it runs on. */
|
|
103
|
+
export const ListedVersion = z.object({
|
|
104
|
+
version: Version,
|
|
105
|
+
minimum: Version.nullable(),
|
|
106
|
+
maximum: Version.nullable(),
|
|
107
|
+
verified: Version.nullable(),
|
|
108
|
+
/** Its manifest's URL, as the listing gives it, which Foundry VTT installs it from. */
|
|
109
|
+
manifest: z.string().nullable(),
|
|
110
|
+
/** Where its release notes are, as the listing gives it. */
|
|
111
|
+
notes: z.string().nullable(),
|
|
112
|
+
});
|
|
113
|
+
/** A package Foundry VTT's listing offers to install, as its Setup screen shows it. */
|
|
114
|
+
export const ListedPackage = z.object({
|
|
115
|
+
package: PackageRef,
|
|
116
|
+
title: z.string(),
|
|
117
|
+
summary: z.string().nullable(),
|
|
118
|
+
author: z.string().nullable(),
|
|
119
|
+
/** Its project's web page, as the listing gives it. */
|
|
120
|
+
url: z.string().nullable(),
|
|
121
|
+
tags: z.array(z.string()),
|
|
122
|
+
/** The IDs of the game systems it is for; empty for any. */
|
|
123
|
+
systems: z.array(z.string()),
|
|
124
|
+
/** Premium content: installing it needs the user's licence. */
|
|
125
|
+
premium: z.boolean(),
|
|
126
|
+
exclusive: z.boolean(),
|
|
127
|
+
/** The newest version, where the listing gives it, which it does for few packages. */
|
|
128
|
+
latest: Version.nullable(),
|
|
129
|
+
/** A version for each line of builds, as the listing lists them. */
|
|
130
|
+
versions: z.array(ListedVersion),
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* `GET /api/v2/listing`, or `?type=module` or `?type=system` for one type: every package Foundry VTT's listing offers,
|
|
134
|
+
* neither archived nor delisted. The same for every client, so it is given with an `ETag`, and answered `304` while it
|
|
135
|
+
* has not changed.
|
|
136
|
+
*/
|
|
137
|
+
export const ListingResponse = z.object({
|
|
138
|
+
packages: z.array(ListedPackage),
|
|
139
|
+
/** When the catalogue's copy of the listing last changed. */
|
|
140
|
+
asOf: Time,
|
|
141
|
+
});
|
|
142
|
+
/** `GET /api/v2/core`: Foundry VTT's builds, oldest first, given with an `ETag` as the listing is. */
|
|
143
|
+
export const CoreResponse = z.object({
|
|
144
|
+
core: z.array(CoreRelease),
|
|
145
|
+
});
|
|
146
|
+
/** `POST /api/v2/recheck`: the packages whose own manifests to check again now. */
|
|
147
|
+
export const RecheckRequest = z.object({
|
|
148
|
+
packages: z.array(PackageRef).min(1).max(MAX_RECHECK_PACKAGES),
|
|
149
|
+
});
|
|
150
|
+
/** A package rechecked: what its own manifest gives now, and whether that is a version the catalogue does not hold. */
|
|
151
|
+
export const RecheckedPackage = z.object({
|
|
152
|
+
package: PackageRef,
|
|
153
|
+
own: OwnManifest,
|
|
154
|
+
/** Whether it gave a version not held: the package is queued, and given as pending. */
|
|
155
|
+
changed: z.boolean(),
|
|
156
|
+
});
|
|
157
|
+
/**
|
|
158
|
+
* `POST /api/v2/recheck`: each package asked for that the catalogue holds, once, with what its own manifest gives now;
|
|
159
|
+
* one checked in the last {@link RECHECK_MIN_SECONDS} is given as it was then. A package not held is left out: look it
|
|
160
|
+
* up, and it is queued.
|
|
161
|
+
*/
|
|
162
|
+
export const RecheckResponse = z.object({
|
|
163
|
+
packages: z.array(RecheckedPackage),
|
|
164
|
+
/** The packages that gave a version not held, queued to be crawled: look them up again after `retryAfter`. */
|
|
165
|
+
pending: z.array(PendingPackage),
|
|
166
|
+
});
|
|
167
|
+
/** `POST /api/v2/manifest`: a manifest URL a user gives, and the type of package they mean to install from it. */
|
|
168
|
+
export const ManifestRequest = z.object({
|
|
169
|
+
url: z.url({ protocol: /^https?$/ }),
|
|
170
|
+
type: z.enum(['module', 'system']),
|
|
171
|
+
});
|
|
172
|
+
/**
|
|
173
|
+
* `POST /api/v2/manifest`: the package the manifest describes, with its title, as a release whose manifest is the URL
|
|
174
|
+
* given, for its version alone, since what it gives is what the user chose; or why it is none. The catalogue queues
|
|
175
|
+
* the package, found by the URL, so that a lookup soon holds its other releases.
|
|
176
|
+
*
|
|
177
|
+
* - `unreadable`: it could not be had. `reason` is as a gap gives it, or `refused`, a URL that may not be fetched,
|
|
178
|
+
* such as one of a private address, or that redirects too often; or `too-large`.
|
|
179
|
+
* - `other-type`: it is a manifest of the other type of package, which Foundry VTT would install as the type asked.
|
|
180
|
+
* - `not-manifest`: what it gave is not a manifest.
|
|
181
|
+
*/
|
|
182
|
+
export const ManifestResponse = z.union([
|
|
183
|
+
z.object({ ok: z.literal(true), title: z.string(), release: Release }),
|
|
184
|
+
z.object({
|
|
185
|
+
ok: z.literal(false),
|
|
186
|
+
problem: z.literal('unreadable'),
|
|
187
|
+
reason: z.enum(['http', 'network', 'invalid', 'refused', 'too-large']),
|
|
188
|
+
status: z.int().exactOptional(),
|
|
189
|
+
host: z.string(),
|
|
190
|
+
}),
|
|
191
|
+
z.object({ ok: z.literal(false), problem: z.literal('other-type'), type: z.enum(['module', 'system']) }),
|
|
192
|
+
z.object({ ok: z.literal(false), problem: z.literal('not-manifest') }),
|
|
193
|
+
]);
|
|
194
|
+
//# sourceMappingURL=v2.js.map
|
package/dist/v2.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2.js","sourceRoot":"","sources":["../src/v2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEhD,yEAAyE;AACzE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,qDAAqD;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,cAAc,EAAE,CAAC;AAEpD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,WAAW,SAAS,CAAC;AAEnD,wGAAwG;AACxG,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,WAAW,UAAU,CAAC;AAErD,wCAAwC;AACxC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,WAAW,OAAO,CAAC;AAE/C,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,WAA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AK,CAAC;QACpB,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;QAChC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QACtE,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE;QAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;IACF,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;IACxG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CACvE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mondarth/fvtt-package-catalogue-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The API contract of the Foundry VTT package catalogue: zod schemas and types of every request and response.",
|
|
5
5
|
"author": "Ulenar of Mondarth",
|
|
6
6
|
"license": "MIT",
|