@bscotch/stitch-launcher
Version:
Manage GameMaker IDE and runtime installations for fast switching between versions.
57 lines • 1.8 kB
JavaScript
import { z } from 'zod';
export { gameMakerChannelSchema, gameMakerFeedOptionsSchema, } from './GameMakerFeeds.types.js';
const gameMakerKnownPathIdSchema = z.enum([
'gameMakerDataDir',
'defaultMacrosFile',
'runtimeFeedsConfigFile',
'initialDefaultMacrosFile',
'runtimesCacheDir',
'gameMakerIdeDir',
'gameMakerIdeExe',
'gameMakerUserDir',
'activeUserFile',
'uiLogFile',
'activeRuntimeConfigFile',
]);
export const gameMakerKnownPathSchema = z.object({
id: gameMakerKnownPathIdSchema,
path: z.string(),
name: z.string(),
description: z.string(),
});
export const gameMakerParsedFeedSchema = z.object({
rss: z.object({
channel: z.object({
title: z.string(),
description: z.string(),
link: z.string(),
item: z.preprocess((arg) => {
if (!Array.isArray(arg)) {
return [arg];
}
return arg;
}, z.array(z.object({
title: z.string().regex(/^Version \d+\.\d+\.\d+\.\d+$/),
pubDate: z.string(),
link: z.string().optional(),
}))),
}),
}),
});
export const gameMakerUserTokenPayloadSchema = z.looseObject({
exp: z.number(),
});
export const gameMakerUserDataSchema = z.looseObject({
deviceID: z.string().optional(),
login: z
.string()
.describe("The user's email address. The 'name' part is used as the local username")
.optional(),
userID: z
.string()
.describe('Local user identifier, used to construct the user directory')
.optional(),
accessToken: z.string().optional(),
refreshToken: z.string().optional(),
});
//# sourceMappingURL=GameMakerLauncher.types.js.map