2021-08-17 03:36:13 +03:00
|
|
|
import { Poke, Scry } from '../lib';
|
2021-08-23 07:37:36 +03:00
|
|
|
import { Chad } from './types';
|
|
|
|
|
|
|
|
export function chadIsRunning(chad: Chad) {
|
|
|
|
return 'glob' in chad || 'site' in chad;
|
|
|
|
}
|
2021-08-17 03:36:13 +03:00
|
|
|
|
|
|
|
export const scryCharges: Scry = {
|
|
|
|
app: 'docket',
|
|
|
|
path: '/charges'
|
|
|
|
};
|
|
|
|
|
|
|
|
export const scryDockets: Scry = {
|
|
|
|
app: 'docket',
|
|
|
|
path: '/dockets'
|
|
|
|
};
|
|
|
|
|
2021-08-23 07:37:36 +03:00
|
|
|
export const scryTreaties: Scry = {
|
|
|
|
app: 'treaty',
|
|
|
|
path: '/treaties'
|
|
|
|
};
|
|
|
|
|
2021-09-21 07:53:57 +03:00
|
|
|
export const scryDefaultAlly: Scry = {
|
|
|
|
app: 'treaty',
|
|
|
|
path: '/default-ally'
|
|
|
|
};
|
|
|
|
|
2021-08-23 07:37:36 +03:00
|
|
|
export const scryAllies: Scry = {
|
|
|
|
app: 'treaty',
|
|
|
|
path: '/allies'
|
|
|
|
};
|
|
|
|
|
|
|
|
export const scryAllyTreaties = (ship: string): Scry => ({
|
|
|
|
app: 'treaty',
|
|
|
|
path: `/treaties/${ship}`
|
|
|
|
});
|
|
|
|
|
2021-08-17 03:36:13 +03:00
|
|
|
/**
|
|
|
|
* Uninstall a desk, and remove docket
|
|
|
|
*/
|
|
|
|
export function docketUninstall(desk: string): Poke<string> {
|
|
|
|
return {
|
|
|
|
app: 'docket',
|
|
|
|
mark: 'docket-uninstall',
|
|
|
|
json: desk
|
|
|
|
};
|
|
|
|
}
|
2021-08-23 07:37:36 +03:00
|
|
|
|
|
|
|
export function docketInstall(ship: string, desk: string): Poke<any> {
|
|
|
|
return {
|
|
|
|
app: 'docket',
|
|
|
|
mark: 'docket-install',
|
|
|
|
json: `${ship}/${desk}`
|
|
|
|
};
|
|
|
|
}
|
2021-10-04 09:01:29 +03:00
|
|
|
|
|
|
|
export function allyShip(ship: string): Poke<any> {
|
|
|
|
return {
|
|
|
|
app: 'treaty',
|
|
|
|
mark: 'ally-update-0',
|
|
|
|
json: {
|
|
|
|
add: ship
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|