@indietabletop/appkit 5.0.0-4 → 5.0.0-5
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/lib/client.ts +2 -2
- package/lib/index.ts +0 -3
- package/package.json +2 -1
- package/lib/types/spacegits.ts +0 -112
package/lib/client.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { SpaceGits } from "@indietabletop/types";
|
|
1
2
|
import { type Infer, mask, object, string, Struct, unknown } from "superstruct";
|
|
2
3
|
import { Failure, Success } from "./async-op.js";
|
|
3
4
|
import { currentUser, redeemedPledge, sessionInfo } from "./structs.js";
|
|
4
5
|
import type { CurrentUser, FailurePayload, SessionInfo } from "./types.js";
|
|
5
|
-
import type { GangData, GangTombstone } from "./types/spacegits.ts";
|
|
6
6
|
|
|
7
7
|
export type UserGameData = {
|
|
8
8
|
spacegits?: {
|
|
9
|
-
gangs?: (GangData | GangTombstone)[];
|
|
9
|
+
gangs?: (SpaceGits.GangData | SpaceGits.GangTombstone)[];
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
|
package/lib/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indietabletop/appkit",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-5",
|
|
4
4
|
"description": "A collection of modules used in apps built by Indie Tabletop Club",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ariakit/react": "^0.4.17",
|
|
46
46
|
"@indietabletop/tooling": "^5.0.0",
|
|
47
|
+
"@indietabletop/types": "^1.0.0-3",
|
|
47
48
|
"@vanilla-extract/css": "^1.17.2",
|
|
48
49
|
"@vanilla-extract/dynamic": "^2.1.3",
|
|
49
50
|
"@vanilla-extract/recipes": "^0.5.7",
|
package/lib/types/spacegits.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
array,
|
|
3
|
-
assign,
|
|
4
|
-
enums,
|
|
5
|
-
literal,
|
|
6
|
-
nullable,
|
|
7
|
-
number,
|
|
8
|
-
object,
|
|
9
|
-
omit,
|
|
10
|
-
string,
|
|
11
|
-
type Infer,
|
|
12
|
-
} from "superstruct";
|
|
13
|
-
|
|
14
|
-
export type Ref = Infer<ReturnType<typeof ref>>;
|
|
15
|
-
|
|
16
|
-
export type VehicleWeaponRef = Infer<ReturnType<typeof vehicleWeaponRef>>;
|
|
17
|
-
|
|
18
|
-
export type TreatmentRef = Infer<ReturnType<typeof treatmentRef>>;
|
|
19
|
-
|
|
20
|
-
export type RepairRef = Infer<ReturnType<typeof repairRef>>;
|
|
21
|
-
|
|
22
|
-
export type VehicleData = Infer<ReturnType<typeof vehicleData>>;
|
|
23
|
-
|
|
24
|
-
export type GitData = Infer<ReturnType<typeof gitData>>;
|
|
25
|
-
|
|
26
|
-
export type GangTombstone = Infer<ReturnType<typeof gangTombstone>>;
|
|
27
|
-
|
|
28
|
-
export type GangData = Infer<ReturnType<typeof gangData>>;
|
|
29
|
-
|
|
30
|
-
export type GangSnapshotData = Infer<ReturnType<typeof gangSnapshotData>>;
|
|
31
|
-
|
|
32
|
-
export function ref() {
|
|
33
|
-
return object({ id: string() });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function weaponRef() {
|
|
37
|
-
return assign(ref(), object({ count: number() }));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function treatmentRef() {
|
|
41
|
-
return assign(ref(), object({ locationId: string() }));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function vehicleWeaponRef() {
|
|
45
|
-
return assign(
|
|
46
|
-
weaponRef(),
|
|
47
|
-
object({ placement: enums(["FIXED", "PINTLE_MOUNTED"]) }),
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function repairRef() {
|
|
52
|
-
return assign(ref(), object({ locationId: string() }));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function gitData() {
|
|
56
|
-
return object({
|
|
57
|
-
id: string(),
|
|
58
|
-
type: ref(),
|
|
59
|
-
name: string(),
|
|
60
|
-
weapons: array(weaponRef()),
|
|
61
|
-
gear: array(ref()),
|
|
62
|
-
offenses: array(ref()),
|
|
63
|
-
treatments: array(treatmentRef()),
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function vehicleData() {
|
|
68
|
-
return object({
|
|
69
|
-
id: string(),
|
|
70
|
-
type: ref(),
|
|
71
|
-
name: string(),
|
|
72
|
-
mods: array(ref()),
|
|
73
|
-
repairs: array(repairRef()),
|
|
74
|
-
weapons: array(vehicleWeaponRef()),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function gangTombstone() {
|
|
79
|
-
return object({
|
|
80
|
-
id: string(),
|
|
81
|
-
name: string(),
|
|
82
|
-
updatedTs: number(),
|
|
83
|
-
deleted: literal(true),
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function gangData() {
|
|
88
|
-
return object({
|
|
89
|
-
id: string(),
|
|
90
|
-
name: string(),
|
|
91
|
-
description: string(),
|
|
92
|
-
gits: array(gitData()),
|
|
93
|
-
vehicles: array(vehicleData()),
|
|
94
|
-
buildMode: enums([
|
|
95
|
-
"A_LA_CARTE",
|
|
96
|
-
"CHEFS_RECOMMENDATION",
|
|
97
|
-
"CHAOS_MODE",
|
|
98
|
-
"SANDBOX",
|
|
99
|
-
]),
|
|
100
|
-
snapshotId: nullable(string()),
|
|
101
|
-
faction: nullable(ref()),
|
|
102
|
-
stash: number(),
|
|
103
|
-
createdTs: number(),
|
|
104
|
-
updatedTs: number(),
|
|
105
|
-
rulesetVersion: string(),
|
|
106
|
-
deleted: literal(false),
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export function gangSnapshotData() {
|
|
111
|
-
return omit(gangData(), ["snapshotId", "deleted"]);
|
|
112
|
-
}
|