@skyblock-finance/actions 0.9.0 → 0.10.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/data/$schema.json +103 -0
- package/data/forging.json +167 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/data.d.ts +2 -46
- package/dist/data.js +9 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -3
- package/dist/npcs.d.ts +1 -1
- package/dist/npcs.js +23 -23
- package/dist/schema.d.ts +91 -3
- package/dist/schema.js +41 -19
- package/dist/types.d.ts +3 -1
- package/package.json +1 -1
- package/source/data.test.ts +44 -18
- package/source/data.ts +10 -6
- package/source/index.ts +13 -8
- package/source/npcs.ts +24 -24
- package/source/schema.ts +60 -36
- package/source/types.ts +5 -0
package/dist/schema.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const actionIoCrystalSchema: z.ZodObject<{
|
|
3
3
|
amount: z.ZodNumber;
|
|
4
4
|
id: z.ZodString;
|
|
5
|
-
type: z.ZodLiteral<"
|
|
5
|
+
type: z.ZodLiteral<"crystal">;
|
|
6
6
|
}, z.core.$strict>;
|
|
7
7
|
export declare const actionIoCurrencySchema: z.ZodObject<{
|
|
8
8
|
amount: z.ZodNumber;
|
|
@@ -11,6 +11,7 @@ export declare const actionIoCurrencySchema: z.ZodObject<{
|
|
|
11
11
|
coin: "coin";
|
|
12
12
|
copper: "copper";
|
|
13
13
|
gem: "gem";
|
|
14
|
+
"forge-second": "forge-second";
|
|
14
15
|
"north-star": "north-star";
|
|
15
16
|
pest: "pest";
|
|
16
17
|
second: "second";
|
|
@@ -18,13 +19,23 @@ export declare const actionIoCurrencySchema: z.ZodObject<{
|
|
|
18
19
|
}>;
|
|
19
20
|
type: z.ZodLiteral<"currency">;
|
|
20
21
|
}, z.core.$strict>;
|
|
22
|
+
export declare const actionIoItemSchema: z.ZodObject<{
|
|
23
|
+
amount: z.ZodNumber;
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
type: z.ZodLiteral<"item">;
|
|
26
|
+
}, z.core.$strict>;
|
|
21
27
|
export declare const actionIoSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
+
amount: z.ZodNumber;
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
type: z.ZodLiteral<"crystal">;
|
|
31
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
32
|
amount: z.ZodNumber;
|
|
23
33
|
id: z.ZodEnum<{
|
|
24
34
|
bit: "bit";
|
|
25
35
|
coin: "coin";
|
|
26
36
|
copper: "copper";
|
|
27
37
|
gem: "gem";
|
|
38
|
+
"forge-second": "forge-second";
|
|
28
39
|
"north-star": "north-star";
|
|
29
40
|
pest: "pest";
|
|
30
41
|
second: "second";
|
|
@@ -62,6 +73,8 @@ export declare const actionPlaceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
62
73
|
type: z.ZodLiteral<"item">;
|
|
63
74
|
}, z.core.$strict>;
|
|
64
75
|
type: z.ZodLiteral<"anvil">;
|
|
76
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
77
|
+
type: z.ZodLiteral<"forge">;
|
|
65
78
|
}, z.core.$strict>, z.ZodObject<{
|
|
66
79
|
id: z.ZodEnum<{
|
|
67
80
|
ADVENTURER: "ADVENTURER";
|
|
@@ -89,14 +102,38 @@ export declare const actionPlaceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
89
102
|
}, z.core.$strict>>>;
|
|
90
103
|
type: z.ZodLiteral<"workbench">;
|
|
91
104
|
}, z.core.$strict>]>;
|
|
105
|
+
/**
|
|
106
|
+
* NOTE: This schema uses uppercase to align 1-to-1 with the Skyblock Items API's requirements format.
|
|
107
|
+
*/
|
|
108
|
+
export declare const actionRequirementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
|
+
collection: z.ZodEnum<{
|
|
110
|
+
GEMSTONE: "GEMSTONE";
|
|
111
|
+
}>;
|
|
112
|
+
tier: z.ZodInt;
|
|
113
|
+
type: z.ZodLiteral<"COLLECTION">;
|
|
114
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
115
|
+
level: z.ZodInt;
|
|
116
|
+
skill: z.ZodEnum<{
|
|
117
|
+
MINING: "MINING";
|
|
118
|
+
}>;
|
|
119
|
+
type: z.ZodLiteral<"SKILL">;
|
|
120
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
121
|
+
tier: z.ZodInt;
|
|
122
|
+
type: z.ZodLiteral<"HEART_OF_THE_MOUNTAIN">;
|
|
123
|
+
}, z.core.$strict>]>;
|
|
92
124
|
export declare const actionSchema: z.ZodObject<{
|
|
93
125
|
inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
126
|
+
amount: z.ZodNumber;
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
type: z.ZodLiteral<"crystal">;
|
|
129
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
94
130
|
amount: z.ZodNumber;
|
|
95
131
|
id: z.ZodEnum<{
|
|
96
132
|
bit: "bit";
|
|
97
133
|
coin: "coin";
|
|
98
134
|
copper: "copper";
|
|
99
135
|
gem: "gem";
|
|
136
|
+
"forge-second": "forge-second";
|
|
100
137
|
"north-star": "north-star";
|
|
101
138
|
pest: "pest";
|
|
102
139
|
second: "second";
|
|
@@ -109,12 +146,17 @@ export declare const actionSchema: z.ZodObject<{
|
|
|
109
146
|
type: z.ZodLiteral<"item">;
|
|
110
147
|
}, z.core.$strict>]>>;
|
|
111
148
|
outputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
149
|
+
amount: z.ZodNumber;
|
|
150
|
+
id: z.ZodString;
|
|
151
|
+
type: z.ZodLiteral<"crystal">;
|
|
152
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
112
153
|
amount: z.ZodNumber;
|
|
113
154
|
id: z.ZodEnum<{
|
|
114
155
|
bit: "bit";
|
|
115
156
|
coin: "coin";
|
|
116
157
|
copper: "copper";
|
|
117
158
|
gem: "gem";
|
|
159
|
+
"forge-second": "forge-second";
|
|
118
160
|
"north-star": "north-star";
|
|
119
161
|
pest: "pest";
|
|
120
162
|
second: "second";
|
|
@@ -138,6 +180,8 @@ export declare const actionSchema: z.ZodObject<{
|
|
|
138
180
|
type: z.ZodLiteral<"item">;
|
|
139
181
|
}, z.core.$strict>;
|
|
140
182
|
type: z.ZodLiteral<"anvil">;
|
|
183
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
184
|
+
type: z.ZodLiteral<"forge">;
|
|
141
185
|
}, z.core.$strict>, z.ZodObject<{
|
|
142
186
|
id: z.ZodEnum<{
|
|
143
187
|
ADVENTURER: "ADVENTURER";
|
|
@@ -165,16 +209,38 @@ export declare const actionSchema: z.ZodObject<{
|
|
|
165
209
|
}, z.core.$strict>>>;
|
|
166
210
|
type: z.ZodLiteral<"workbench">;
|
|
167
211
|
}, z.core.$strict>]>>;
|
|
212
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
213
|
+
collection: z.ZodEnum<{
|
|
214
|
+
GEMSTONE: "GEMSTONE";
|
|
215
|
+
}>;
|
|
216
|
+
tier: z.ZodInt;
|
|
217
|
+
type: z.ZodLiteral<"COLLECTION">;
|
|
218
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
219
|
+
level: z.ZodInt;
|
|
220
|
+
skill: z.ZodEnum<{
|
|
221
|
+
MINING: "MINING";
|
|
222
|
+
}>;
|
|
223
|
+
type: z.ZodLiteral<"SKILL">;
|
|
224
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
225
|
+
tier: z.ZodInt;
|
|
226
|
+
type: z.ZodLiteral<"HEART_OF_THE_MOUNTAIN">;
|
|
227
|
+
}, z.core.$strict>]>>>;
|
|
168
228
|
}, z.core.$strict>;
|
|
169
229
|
export declare const actionDefinitionSchema: z.ZodObject<{
|
|
230
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
170
231
|
actions: z.ZodArray<z.ZodObject<{
|
|
171
232
|
inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
233
|
+
amount: z.ZodNumber;
|
|
234
|
+
id: z.ZodString;
|
|
235
|
+
type: z.ZodLiteral<"crystal">;
|
|
236
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
172
237
|
amount: z.ZodNumber;
|
|
173
238
|
id: z.ZodEnum<{
|
|
174
239
|
bit: "bit";
|
|
175
240
|
coin: "coin";
|
|
176
241
|
copper: "copper";
|
|
177
242
|
gem: "gem";
|
|
243
|
+
"forge-second": "forge-second";
|
|
178
244
|
"north-star": "north-star";
|
|
179
245
|
pest: "pest";
|
|
180
246
|
second: "second";
|
|
@@ -187,12 +253,17 @@ export declare const actionDefinitionSchema: z.ZodObject<{
|
|
|
187
253
|
type: z.ZodLiteral<"item">;
|
|
188
254
|
}, z.core.$strict>]>>;
|
|
189
255
|
outputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
256
|
+
amount: z.ZodNumber;
|
|
257
|
+
id: z.ZodString;
|
|
258
|
+
type: z.ZodLiteral<"crystal">;
|
|
259
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
190
260
|
amount: z.ZodNumber;
|
|
191
261
|
id: z.ZodEnum<{
|
|
192
262
|
bit: "bit";
|
|
193
263
|
coin: "coin";
|
|
194
264
|
copper: "copper";
|
|
195
265
|
gem: "gem";
|
|
266
|
+
"forge-second": "forge-second";
|
|
196
267
|
"north-star": "north-star";
|
|
197
268
|
pest: "pest";
|
|
198
269
|
second: "second";
|
|
@@ -216,6 +287,8 @@ export declare const actionDefinitionSchema: z.ZodObject<{
|
|
|
216
287
|
type: z.ZodLiteral<"item">;
|
|
217
288
|
}, z.core.$strict>;
|
|
218
289
|
type: z.ZodLiteral<"anvil">;
|
|
290
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
291
|
+
type: z.ZodLiteral<"forge">;
|
|
219
292
|
}, z.core.$strict>, z.ZodObject<{
|
|
220
293
|
id: z.ZodEnum<{
|
|
221
294
|
ADVENTURER: "ADVENTURER";
|
|
@@ -243,6 +316,21 @@ export declare const actionDefinitionSchema: z.ZodObject<{
|
|
|
243
316
|
}, z.core.$strict>>>;
|
|
244
317
|
type: z.ZodLiteral<"workbench">;
|
|
245
318
|
}, z.core.$strict>]>>;
|
|
319
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
320
|
+
collection: z.ZodEnum<{
|
|
321
|
+
GEMSTONE: "GEMSTONE";
|
|
322
|
+
}>;
|
|
323
|
+
tier: z.ZodInt;
|
|
324
|
+
type: z.ZodLiteral<"COLLECTION">;
|
|
325
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
326
|
+
level: z.ZodInt;
|
|
327
|
+
skill: z.ZodEnum<{
|
|
328
|
+
MINING: "MINING";
|
|
329
|
+
}>;
|
|
330
|
+
type: z.ZodLiteral<"SKILL">;
|
|
331
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
332
|
+
tier: z.ZodInt;
|
|
333
|
+
type: z.ZodLiteral<"HEART_OF_THE_MOUNTAIN">;
|
|
334
|
+
}, z.core.$strict>]>>>;
|
|
246
335
|
}, z.core.$strict>>;
|
|
247
|
-
$schema: z.ZodOptional<z.ZodString>;
|
|
248
336
|
}, z.core.$strict>;
|
package/dist/schema.js
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.actionDefinitionSchema = exports.actionSchema = exports.actionPlaceSchema = exports.npcIdSchema = exports.actionIoSchema = exports.actionIoCurrencySchema = exports.
|
|
3
|
+
exports.actionDefinitionSchema = exports.actionSchema = exports.actionRequirementSchema = exports.actionPlaceSchema = exports.npcIdSchema = exports.actionIoSchema = exports.actionIoItemSchema = exports.actionIoCurrencySchema = exports.actionIoCrystalSchema = void 0;
|
|
4
4
|
const v4_1 = require("zod/v4");
|
|
5
|
-
exports.
|
|
6
|
-
.object({
|
|
5
|
+
exports.actionIoCrystalSchema = v4_1.z.strictObject({
|
|
7
6
|
amount: v4_1.z.number(),
|
|
8
7
|
id: v4_1.z.string(),
|
|
9
|
-
type: v4_1.z.literal('
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
exports.actionIoCurrencySchema = v4_1.z
|
|
13
|
-
.object({
|
|
8
|
+
type: v4_1.z.literal('crystal'),
|
|
9
|
+
});
|
|
10
|
+
exports.actionIoCurrencySchema = v4_1.z.strictObject({
|
|
14
11
|
amount: v4_1.z.number(),
|
|
15
12
|
id: v4_1.z.enum([
|
|
16
13
|
'bit',
|
|
17
14
|
'coin',
|
|
18
15
|
'copper',
|
|
19
16
|
'gem',
|
|
17
|
+
'forge-second',
|
|
20
18
|
'north-star',
|
|
21
19
|
'pest',
|
|
22
20
|
'second',
|
|
23
21
|
'usd',
|
|
24
22
|
]),
|
|
25
23
|
type: v4_1.z.literal('currency'),
|
|
26
|
-
})
|
|
27
|
-
|
|
24
|
+
});
|
|
25
|
+
exports.actionIoItemSchema = v4_1.z.strictObject({
|
|
26
|
+
amount: v4_1.z.number(),
|
|
27
|
+
id: v4_1.z.string(),
|
|
28
|
+
type: v4_1.z.literal('item'),
|
|
29
|
+
});
|
|
28
30
|
exports.actionIoSchema = v4_1.z.discriminatedUnion('type', [
|
|
31
|
+
exports.actionIoCrystalSchema,
|
|
29
32
|
exports.actionIoCurrencySchema,
|
|
30
33
|
exports.actionIoItemSchema,
|
|
31
34
|
]);
|
|
@@ -49,6 +52,9 @@ exports.actionPlaceSchema = v4_1.z.discriminatedUnion('type', [
|
|
|
49
52
|
right: exports.actionIoItemSchema,
|
|
50
53
|
type: v4_1.z.literal('anvil'),
|
|
51
54
|
}),
|
|
55
|
+
v4_1.z.strictObject({
|
|
56
|
+
type: v4_1.z.literal('forge'),
|
|
57
|
+
}),
|
|
52
58
|
v4_1.z.strictObject({
|
|
53
59
|
id: exports.npcIdSchema,
|
|
54
60
|
type: v4_1.z.literal('npc'),
|
|
@@ -62,16 +68,32 @@ exports.actionPlaceSchema = v4_1.z.discriminatedUnion('type', [
|
|
|
62
68
|
type: v4_1.z.literal('workbench'),
|
|
63
69
|
}),
|
|
64
70
|
]);
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
/**
|
|
72
|
+
* NOTE: This schema uses uppercase to align 1-to-1 with the Skyblock Items API's requirements format.
|
|
73
|
+
*/
|
|
74
|
+
exports.actionRequirementSchema = v4_1.z.discriminatedUnion('type', [
|
|
75
|
+
v4_1.z.strictObject({
|
|
76
|
+
collection: v4_1.z.enum(['GEMSTONE' /* to be added as-needed */]),
|
|
77
|
+
tier: v4_1.z.int().min(1).max(10),
|
|
78
|
+
type: v4_1.z.literal('COLLECTION'),
|
|
79
|
+
}),
|
|
80
|
+
v4_1.z.strictObject({
|
|
81
|
+
level: v4_1.z.int().min(1).max(60),
|
|
82
|
+
skill: v4_1.z.enum(['MINING' /* to be added as-needed */]),
|
|
83
|
+
type: v4_1.z.literal('SKILL'),
|
|
84
|
+
}),
|
|
85
|
+
v4_1.z.strictObject({
|
|
86
|
+
tier: v4_1.z.int().min(1).max(10),
|
|
87
|
+
type: v4_1.z.literal('HEART_OF_THE_MOUNTAIN'),
|
|
88
|
+
}),
|
|
89
|
+
]);
|
|
90
|
+
exports.actionSchema = v4_1.z.strictObject({
|
|
67
91
|
inputs: v4_1.z.array(exports.actionIoSchema),
|
|
68
92
|
outputs: v4_1.z.array(exports.actionIoSchema),
|
|
69
93
|
place: v4_1.z.array(exports.actionPlaceSchema),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
exports.actionDefinitionSchema = v4_1.z
|
|
73
|
-
.object({
|
|
74
|
-
actions: v4_1.z.array(exports.actionSchema),
|
|
94
|
+
requirements: v4_1.z.array(exports.actionRequirementSchema).optional(),
|
|
95
|
+
});
|
|
96
|
+
exports.actionDefinitionSchema = v4_1.z.strictObject({
|
|
75
97
|
$schema: v4_1.z.string().optional(),
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
actions: v4_1.z.array(exports.actionSchema),
|
|
99
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import { actionIoCurrencySchema, actionIoItemSchema, actionIoSchema, actionSchema, npcIdSchema } from './schema';
|
|
2
|
+
import { actionIoCrystalSchema, actionIoCurrencySchema, actionIoItemSchema, actionIoSchema, actionRequirementSchema, actionSchema, npcIdSchema } from './schema';
|
|
3
3
|
export type Action = z.output<typeof actionSchema>;
|
|
4
4
|
export type ActionCurrency = z.output<typeof actionIoCurrencySchema.shape.id>;
|
|
5
5
|
export type ActionIo = z.output<typeof actionIoSchema>;
|
|
6
|
+
export type ActionIoCrystal = z.output<typeof actionIoCrystalSchema>;
|
|
6
7
|
export type ActionIoCurrency = z.output<typeof actionIoCurrencySchema>;
|
|
7
8
|
export type ActionIoItem = z.output<typeof actionIoItemSchema>;
|
|
9
|
+
export type ActionRequirement = z.output<typeof actionRequirementSchema>;
|
|
8
10
|
export type NpcId = z.output<typeof npcIdSchema>;
|
package/package.json
CHANGED
package/source/data.test.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { allActions } from './data'
|
|
3
|
-
import { z } from 'zod/v4'
|
|
4
|
-
import { describe, expect, test } from 'bun:test'
|
|
1
|
+
import { expect, test } from 'bun:test'
|
|
5
2
|
import assert from 'node:assert'
|
|
3
|
+
|
|
4
|
+
import jsonStableStringify from 'json-stable-stringify'
|
|
5
|
+
import { z } from 'zod/v4'
|
|
6
|
+
|
|
7
|
+
import { allActions } from './data'
|
|
8
|
+
import { actionSchema } from './schema'
|
|
6
9
|
import { ActionIoItem } from './types'
|
|
7
10
|
|
|
8
11
|
test('all actions follow the schema', () => {
|
|
@@ -68,34 +71,57 @@ test('sumUp works', () => {
|
|
|
68
71
|
)
|
|
69
72
|
})
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
test('every action’s workbench inputs match its crafing grid', () => {
|
|
72
75
|
for (const action of allActions) {
|
|
73
76
|
for (const grid of action.place.filter((x) => x.type === 'workbench')) {
|
|
74
|
-
|
|
75
|
-
assert(grid.type === 'workbench')
|
|
77
|
+
assert(grid.type === 'workbench')
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
const actual = sumUp(action.inputs.filter((x) => x.type === 'item'))
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
const expected = sumUp(grid.grid.filter((x) => x !== null))
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
expect(
|
|
84
|
+
actual,
|
|
85
|
+
`${JSON.stringify(action)} doesn't match its crafting grid`,
|
|
86
|
+
).toEqual(expected)
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
})
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
test('every action’s anvil inputs match its crafing grid', () => {
|
|
88
92
|
for (const action of allActions) {
|
|
89
93
|
for (const grid of action.place.filter((x) => x.type === 'anvil')) {
|
|
90
|
-
|
|
91
|
-
assert(grid.type === 'anvil')
|
|
94
|
+
assert(grid.type === 'anvil')
|
|
92
95
|
|
|
93
|
-
|
|
96
|
+
const actual = sumUp(action.inputs.filter((x) => x.type === 'item'))
|
|
97
|
+
|
|
98
|
+
const expected = sumUp([grid.left, grid.right])
|
|
99
|
+
|
|
100
|
+
expect(actual, `${JSON.stringify(action)} doesn't match`).toEqual(
|
|
101
|
+
expected,
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
test('no duplicate actions exist', () => {
|
|
108
|
+
const seen = new Set<string>()
|
|
109
|
+
|
|
110
|
+
for (const action of allActions) {
|
|
111
|
+
for (const place of action.place) {
|
|
112
|
+
const syntheticAction = {
|
|
113
|
+
...action,
|
|
114
|
+
place,
|
|
115
|
+
}
|
|
116
|
+
const json = jsonStableStringify(syntheticAction)
|
|
94
117
|
|
|
95
|
-
|
|
118
|
+
if (!json) throw new Error(`invalid action: ${JSON.stringify(action)}`)
|
|
96
119
|
|
|
97
|
-
|
|
98
|
-
|
|
120
|
+
if (seen.has(json)) {
|
|
121
|
+
throw new Error(`duplicate action: ${json}`)
|
|
122
|
+
} else {
|
|
123
|
+
seen.add(json)
|
|
124
|
+
}
|
|
99
125
|
}
|
|
100
126
|
}
|
|
101
127
|
})
|
package/source/data.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { actions as _adventurer } from '../data/merchants/adventurer.json'
|
|
2
1
|
import { actions as _bitsCrafts } from '../data/bits-crafts.json'
|
|
2
|
+
import { actions as _crimsonIsle } from '../data/crimson-isle.json'
|
|
3
|
+
import { actions as _forging } from '../data/forging.json'
|
|
4
|
+
import { actions as _gems } from '../data/gems.json'
|
|
5
|
+
import { actions as _gemstones } from '../data/gemstones.json'
|
|
6
|
+
import { actions as _adventurer } from '../data/merchants/adventurer.json'
|
|
3
7
|
import { actions as _bubu } from '../data/merchants/bubu.json'
|
|
4
8
|
import { actions as _bulvar } from '../data/merchants/bulvar.json'
|
|
5
|
-
import { actions as _crimsonIsle } from '../data/crimson-isle.json'
|
|
6
9
|
import { actions as _einary } from '../data/merchants/einary.json'
|
|
7
10
|
import { actions as _elizabeth } from '../data/merchants/elizabeth.json'
|
|
8
11
|
import { actions as _fishingMerchant } from '../data/merchants/fishing-merchant.json'
|
|
9
|
-
import { actions as _gems } from '../data/gems.json'
|
|
10
|
-
import { actions as _gemstones } from '../data/gemstones.json'
|
|
11
|
-
import { actions as _northStarsCrafts } from '../data/north-stars-crafts.json'
|
|
12
12
|
import { actions as _phillip } from '../data/merchants/phillip.json'
|
|
13
13
|
import { actions as _plumberJoe } from '../data/merchants/plumber-joe.json'
|
|
14
14
|
import { actions as _seymour } from '../data/merchants/seymour.json'
|
|
15
15
|
import { actions as _skymart } from '../data/merchants/skymart.json'
|
|
16
16
|
import { actions as _smithmonger } from '../data/merchants/smithmonger.json'
|
|
17
|
+
import { actions as _northStarsCrafts } from '../data/north-stars-crafts.json'
|
|
17
18
|
import { actions as _wood } from '../data/wood.json'
|
|
19
|
+
|
|
18
20
|
import { Action } from './types'
|
|
19
21
|
|
|
20
22
|
// merchants
|
|
@@ -35,12 +37,13 @@ export const smithmonger = _smithmonger as Action[]
|
|
|
35
37
|
|
|
36
38
|
export const bitsCrafts = _bitsCrafts as Action[]
|
|
37
39
|
export const crimsonIsle = _crimsonIsle as Action[]
|
|
40
|
+
export const forging = _forging as Action[]
|
|
38
41
|
export const gems = _gems as Action[]
|
|
39
42
|
export const gemstones = _gemstones as Action[]
|
|
40
43
|
export const northStarsCrafts = _northStarsCrafts as Action[]
|
|
41
44
|
export const wood = _wood as Action[]
|
|
42
45
|
|
|
43
|
-
export const allActions = [
|
|
46
|
+
export const allActions: Action[] = [
|
|
44
47
|
...adventurer,
|
|
45
48
|
...bitsCrafts,
|
|
46
49
|
...bubu,
|
|
@@ -49,6 +52,7 @@ export const allActions = [
|
|
|
49
52
|
...einary,
|
|
50
53
|
...elizabeth,
|
|
51
54
|
...fishingMerchant,
|
|
55
|
+
...forging,
|
|
52
56
|
...gems,
|
|
53
57
|
...gemstones,
|
|
54
58
|
...northStarsCrafts,
|
package/source/index.ts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
export * from './data'
|
|
2
|
+
export { npcs } from './npcs'
|
|
3
|
+
export {
|
|
4
|
+
actionIoCrystalSchema,
|
|
5
|
+
actionIoCurrencySchema,
|
|
6
|
+
actionIoItemSchema,
|
|
7
|
+
actionIoSchema,
|
|
8
|
+
actionPlaceSchema,
|
|
9
|
+
actionRequirementSchema,
|
|
10
|
+
actionSchema,
|
|
11
|
+
npcIdSchema,
|
|
12
|
+
} from './schema'
|
|
2
13
|
export {
|
|
3
14
|
Action,
|
|
4
15
|
ActionCurrency,
|
|
5
16
|
ActionIo,
|
|
17
|
+
ActionIoCrystal,
|
|
6
18
|
ActionIoCurrency,
|
|
7
19
|
ActionIoItem,
|
|
20
|
+
ActionRequirement,
|
|
8
21
|
NpcId,
|
|
9
22
|
} from './types'
|
|
10
|
-
export {
|
|
11
|
-
actionIoItemSchema,
|
|
12
|
-
actionIoSchema,
|
|
13
|
-
actionPlaceSchema,
|
|
14
|
-
actionSchema,
|
|
15
|
-
npcIdSchema,
|
|
16
|
-
} from './schema'
|
|
17
|
-
export { npcs } from './npcs'
|
package/source/npcs.ts
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
import { NpcId } from './types'
|
|
2
2
|
|
|
3
3
|
type NpcMetadata = {
|
|
4
|
-
name: string
|
|
5
4
|
links: {
|
|
6
5
|
communityWiki: `https://hypixelskyblock.minecraft.wiki/${string}` | null
|
|
7
6
|
hypixelWiki: `https://wiki.hypixel.net/${string}` | null
|
|
8
7
|
}
|
|
8
|
+
name: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const _npcs: Record<NpcId, NpcMetadata> = {
|
|
12
12
|
ADVENTURER: {
|
|
13
|
-
name: 'Adventurer',
|
|
14
13
|
links: {
|
|
15
14
|
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Adventurer',
|
|
16
15
|
hypixelWiki: 'https://wiki.hypixel.net/Adventurer',
|
|
17
16
|
},
|
|
17
|
+
name: 'Adventurer',
|
|
18
18
|
},
|
|
19
19
|
ALCHEMIST: {
|
|
20
|
-
name: 'Elizabeth',
|
|
21
20
|
links: {
|
|
22
21
|
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Alchemist',
|
|
23
22
|
hypixelWiki: 'https://wiki.hypixel.net/Alchemist',
|
|
24
23
|
},
|
|
24
|
+
name: 'Alchemist',
|
|
25
25
|
},
|
|
26
26
|
BUBU: {
|
|
27
|
-
name: 'Bubu',
|
|
28
27
|
links: {
|
|
29
28
|
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Bubu',
|
|
30
29
|
hypixelWiki: 'https://wiki.hypixel.net/Bubu',
|
|
31
30
|
},
|
|
31
|
+
name: 'Bubu',
|
|
32
32
|
},
|
|
33
33
|
BULVAR: {
|
|
34
|
-
name: 'Bulvar',
|
|
35
34
|
links: {
|
|
36
35
|
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Bulvar',
|
|
37
36
|
hypixelWiki: 'https://wiki.hypixel.net/Bulvar',
|
|
38
37
|
},
|
|
38
|
+
name: 'Bulvar',
|
|
39
|
+
},
|
|
40
|
+
EINARY: {
|
|
41
|
+
links: {
|
|
42
|
+
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Einary',
|
|
43
|
+
hypixelWiki: 'https://wiki.hypixel.net/Einary',
|
|
44
|
+
},
|
|
45
|
+
name: 'Einary',
|
|
39
46
|
},
|
|
40
47
|
ELIZABETH: {
|
|
41
|
-
name: 'Elizabeth',
|
|
42
48
|
links: {
|
|
43
49
|
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Elizabeth',
|
|
44
50
|
hypixelWiki: 'https://wiki.hypixel.net/Elizabeth',
|
|
45
51
|
},
|
|
46
|
-
},
|
|
47
|
-
EINARY: {
|
|
48
52
|
name: 'Elizabeth',
|
|
49
|
-
links: {
|
|
50
|
-
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Einary',
|
|
51
|
-
hypixelWiki: 'https://wiki.hypixel.net/Einary',
|
|
52
|
-
},
|
|
53
53
|
},
|
|
54
54
|
FISHING_MERCHANT: {
|
|
55
|
-
name: 'Fishing Merchant',
|
|
56
55
|
links: {
|
|
57
56
|
communityWiki:
|
|
58
57
|
'https://hypixelskyblock.minecraft.wiki/w/Fishing_Merchant',
|
|
59
58
|
hypixelWiki: 'https://wiki.hypixel.net/Fishing_Merchant',
|
|
60
59
|
},
|
|
60
|
+
name: 'Fishing Merchant',
|
|
61
61
|
},
|
|
62
62
|
PHILLIP: {
|
|
63
|
-
name: 'Pesthunter Phillip',
|
|
64
63
|
links: {
|
|
65
64
|
communityWiki:
|
|
66
65
|
'https://hypixelskyblock.minecraft.wiki/w/Pesthunter_Phillip',
|
|
67
66
|
hypixelWiki: 'https://wiki.hypixel.net/Pesthunter_Phillip',
|
|
68
67
|
},
|
|
68
|
+
name: 'Pesthunter Phillip',
|
|
69
|
+
},
|
|
70
|
+
PLUMBER_JOE: {
|
|
71
|
+
links: {
|
|
72
|
+
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Plumber_Joe',
|
|
73
|
+
hypixelWiki: 'https://wiki.hypixel.net/Plumber_Joe',
|
|
74
|
+
},
|
|
75
|
+
name: 'Plumber Joe',
|
|
69
76
|
},
|
|
70
77
|
SEYMOUR: {
|
|
71
|
-
name: 'Seymour',
|
|
72
78
|
links: {
|
|
73
79
|
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Seymour',
|
|
74
80
|
hypixelWiki: 'https://wiki.hypixel.net/Seymour',
|
|
75
81
|
},
|
|
82
|
+
name: 'Seymour',
|
|
76
83
|
},
|
|
77
84
|
SKYMART: {
|
|
78
|
-
name: 'SkyMart',
|
|
79
85
|
links: {
|
|
80
86
|
communityWiki:
|
|
81
87
|
'https://hypixelskyblock.minecraft.wiki/w/The_Garden#The_Desk',
|
|
82
88
|
hypixelWiki: 'https://wiki.hypixel.net/Garden#Desk',
|
|
83
89
|
},
|
|
90
|
+
name: 'SkyMart',
|
|
84
91
|
},
|
|
85
92
|
SMITHMONGER: {
|
|
86
|
-
name: 'Smithmonger',
|
|
87
93
|
links: {
|
|
88
94
|
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Smithmonger',
|
|
89
95
|
hypixelWiki: 'https://wiki.hypixel.net/Smithmonger',
|
|
90
96
|
},
|
|
91
|
-
|
|
92
|
-
PLUMBER_JOE: {
|
|
93
|
-
name: 'Plumber Joe',
|
|
94
|
-
links: {
|
|
95
|
-
communityWiki: 'https://hypixelskyblock.minecraft.wiki/w/Plumber_Joe',
|
|
96
|
-
hypixelWiki: 'https://wiki.hypixel.net/Plumber_Joe',
|
|
97
|
-
},
|
|
97
|
+
name: 'Smithmonger',
|
|
98
98
|
},
|
|
99
99
|
}
|
|
100
100
|
|