diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63da1cd..14bd6f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,13 @@ jobs: - uses: oven-sh/setup-bun@v1 - run: bun install - run: bun run check + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + - run: bun install + - run: bun run test validate-schemas: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ff109ea..fc08622 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,6 +29,6 @@ jobs: - run: bun run build check test - name: publish - run: bun internals/scripts/source/publish.ts + run: bun internals/scripts/source/publish.mts env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.vscode/actions.code-snippets b/.vscode/actions.code-snippets new file mode 100644 index 0000000..48db197 --- /dev/null +++ b/.vscode/actions.code-snippets @@ -0,0 +1,39 @@ +{ + "Action for Crafting": { + "prefix": "actr", + "body": [ + "{", + "\t\"inputs\": [", + "\t\t{ \"amount\": ${1:1}, \"id\": \"${2:TODO: Insert Item ID}\", \"type\": \"item\" }", + "\t],", + "\t\"outputs\": [", + "\t\t{ \"amount\": ${3:1}, \"id\": \"${4:TODO: Insert Item ID}\", \"type\": \"item\" }", + "\t],", + "\t\"place\": [", + "\t\t{", + "\t\t\t\"grid\": [", + "\t\t\t\t${5:null},", + "\t\t\t\t${6:null},", + "\t\t\t\t${7:null},", + "\t\t\t\t${8:null},", + "\t\t\t\t${9:null},", + "\t\t\t\t${10:null},", + "\t\t\t\t${11:null},", + "\t\t\t\t${12:null},", + "\t\t\t\t${13:null}", + "\t\t\t],", + "\t\t\t\"type\": \"workbench\"", + "\t\t}", + "\t]", + "},", + ], + "description": "Add Recipe Action", + }, + "Action Input/Output Item": { + "prefix": "acti", + "body": [ + "{ \"amount\": ${1:1}, \"id\": \"${2:TODO: Insert Item ID}\", \"type\": \"item\" }", + ], + "description": "Add item in action.inputs and action.outputs", + }, +} diff --git a/README.md b/README.md index 9ab2dde..2f34e93 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ This repo contains the opensource parts of | Name | What does this do? | Getting Started | | --------------------------: | :------------------------------------------- | :--------------------------------- | +| `@skyblock-finance/actions` | Recipes, etc. | [README](/packages/actions#readme) | | `@skyblock-finance/schemas` | Strong validation for Skyblock API responses | [README](/packages/schemas#readme) | ## Contributing diff --git a/bun.lockb b/bun.lockb index a34a50e..c5b75eb 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/internals/eslint-config/turbo.json b/internals/eslint-config/turbo.json index fed7bb1..e085ed6 100644 --- a/internals/eslint-config/turbo.json +++ b/internals/eslint-config/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turbo.build/schema.json", + "$schema": "https://turbo.build/schema.v1.json", "extends": ["//"], "pipeline": {} } diff --git a/internals/fake-root/turbo.json b/internals/fake-root/turbo.json index b56687d..311a2cc 100644 --- a/internals/fake-root/turbo.json +++ b/internals/fake-root/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turbo.build/schema.json", + "$schema": "https://turbo.build/schema.v1.json", "extends": ["//"], "pipeline": { "check:eslint": { diff --git a/internals/scripts/source/publish.ts b/internals/scripts/source/publish.mts similarity index 94% rename from internals/scripts/source/publish.ts rename to internals/scripts/source/publish.mts index 2c73c51..63d15b6 100644 --- a/internals/scripts/source/publish.ts +++ b/internals/scripts/source/publish.mts @@ -1,7 +1,7 @@ import { $, semver } from 'bun' import { z } from 'zod' -const packagesToConsider = ['packages/schemas'] +const packagesToConsider = ['packages/actions', 'packages/schemas'] const packageJsonSchema = z.object({ name: z.string(), version: z.string() }) diff --git a/knip.json b/knip.json index a76b8f0..845ae3e 100644 --- a/knip.json +++ b/knip.json @@ -14,6 +14,7 @@ }, "packages/*": { "entry": ["scripts/*.ts", "source/index.ts"], + "ignore": ["**/*.test.ts"], "project": ["source/**/*.ts"] } } diff --git a/packages/actions/README.md b/packages/actions/README.md new file mode 100644 index 0000000..a514309 --- /dev/null +++ b/packages/actions/README.md @@ -0,0 +1,3 @@ +# @skyblock-finance/actions + +This package contains actions players can take in Hypixel Skyblock diff --git a/packages/actions/data/$schema.json b/packages/actions/data/$schema.json new file mode 100644 index 0000000..8f5ed34 --- /dev/null +++ b/packages/actions/data/$schema.json @@ -0,0 +1,131 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema", + "additionalProperties": false, + "definitions": { + "currencyAction": { + "additionalProperties": false, + "properties": { + "amount": { + "type": "number" + }, + "type": { + "enum": ["bit", "coin", "mote", "north-star"], + "type": "string" + } + }, + "required": ["amount", "type"] + }, + "itemAction": { + "additionalProperties": false, + "properties": { + "amount": { + "type": "number" + }, + "id": { + "type": "string" + }, + "type": { + "const": "item" + } + }, + "required": ["id", "amount", "type"], + "type": "object" + } + }, + "properties": { + "$schema": { + "type": "string" + }, + "actions": { + "items": { + "additionalProperties": false, + "properties": { + "inputs": { + "items": { + "oneOf": [ + { "$ref": "#/definitions/currencyAction" }, + { "$ref": "#/definitions/itemAction" } + ], + "type": "object" + }, + "type": "array" + }, + "outputs": { + "items": { + "oneOf": [ + { "$ref": "#/definitions/currencyAction" }, + { "$ref": "#/definitions/itemAction" } + ], + "type": "object" + }, + "type": "array" + }, + "place": { + "items": { + "oneOf": [ + { + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "type": { + "const": "item" + } + }, + "required": ["id", "type"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "grid": { + "items": { + "maxLength": 9, + "minLength": 9, + "oneOf": [ + { "$ref": "#/definitions/itemAction" }, + { "type": "null" } + ] + }, + "type": "array" + }, + "type": { + "const": "workbench" + } + }, + "required": ["type"], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "type": { + "const": "npc" + } + }, + "required": ["id", "type"], + "type": "object" + } + ], + "type": "object" + }, + "type": "array" + }, + "requirements": { + "items": {}, + "type": "array" + } + }, + "required": ["inputs", "outputs", "place"], + "type": "object" + }, + "type": "array" + } + }, + "required": ["actions"], + "type": "object" +} diff --git a/packages/actions/data/bits-crafts.json b/packages/actions/data/bits-crafts.json new file mode 100644 index 0000000..0164da6 --- /dev/null +++ b/packages/actions/data/bits-crafts.json @@ -0,0 +1,921 @@ +{ + "$schema": "./$schema.json", + "actions": [ + { + "inputs": [{ "amount": 160, "id": "IRON", "type": "item" }], + "outputs": [{ "amount": 1, "id": "ENCHANTED_IRON", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 64, "id": "IRON", "type": "item" }, + { "amount": 64, "id": "IRON", "type": "item" }, + { "amount": 32, "id": "IRON", "type": "item" }, + null, + null, + null, + null, + null, + null + ], + "type": "workbench" + }, + { + "grid": [ + null, + { "amount": 32, "id": "IRON", "type": "item" }, + null, + { "amount": 32, "id": "IRON", "type": "item" }, + { "amount": 32, "id": "IRON", "type": "item" }, + { "amount": 32, "id": "IRON", "type": "item" }, + null, + { "amount": 32, "id": "IRON", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 160, "id": "ENCHANTED_COAL", "type": "item" }], + "outputs": [ + { "amount": 1, "id": "ENCHANTED_COAL_BLOCK", "type": "item" } + ], + "place": [ + { + "grid": [ + { "amount": 64, "id": "ENCHANTED_COAL", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_COAL", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_COAL", "type": "item" }, + null, + null, + null, + null, + null, + null + ], + "type": "workbench" + }, + { + "grid": [ + null, + { "amount": 32, "id": "ENCHANTED_COAL", "type": "item" }, + null, + { "amount": 32, "id": "ENCHANTED_COAL", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_COAL", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_COAL", "type": "item" }, + null, + { "amount": 32, "id": "ENCHANTED_COAL", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 2, "id": "ENCHANTED_COAL_BLOCK", "type": "item" }, + { "amount": 3, "id": "ENCHANTED_IRON", "type": "item" } + ], + "outputs": [ + { "amount": 1, "id": "ENCHANTED_LAVA_BUCKET", "type": "item" } + ], + "place": [ + { + "grid": [ + { "amount": 1, "id": "ENCHANTED_IRON", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_COAL_BLOCK", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_IRON", "type": "item" }, + null, + { "amount": 1, "id": "ENCHANTED_IRON", "type": "item" }, + null, + null, + null, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "HEAT_CORE", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_LAVA_BUCKET", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "MAGMA_BUCKET", "type": "item" }], + "place": [ + { + "grid": [ + null, + null, + null, + { "amount": 1, "id": "ENCHANTED_LAVA_BUCKET", "type": "item" }, + { "amount": 1, "id": "HEAT_CORE", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_LAVA_BUCKET", "type": "item" }, + null, + null, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "HEAT_CORE", "type": "item" }, + { "amount": 2, "id": "MAGMA_BUCKET", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "PLASMA_BUCKET", "type": "item" }], + "place": [ + { + "grid": [ + null, + null, + null, + { "amount": 1, "id": "MAGMA_BUCKET", "type": "item" }, + { "amount": 1, "id": "HEAT_CORE", "type": "item" }, + { "amount": 1, "id": "MAGMA_BUCKET", "type": "item" }, + null, + null, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 160, "id": "MITHRIL", "type": "item" }], + "outputs": [{ "amount": 1, "id": "ENCHANTED_MITHRIL", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 64, "id": "MITHRIL", "type": "item" }, + { "amount": 64, "id": "MITHRIL", "type": "item" }, + { "amount": 32, "id": "MITHRIL", "type": "item" }, + null, + null, + null, + null, + null, + null + ], + "type": "workbench" + }, + { + "grid": [ + null, + { "amount": 32, "id": "MITHRIL", "type": "item" }, + null, + { "amount": 32, "id": "MITHRIL", "type": "item" }, + { "amount": 32, "id": "MITHRIL", "type": "item" }, + { "amount": 32, "id": "MITHRIL", "type": "item" }, + null, + { "amount": 32, "id": "MITHRIL", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "MAGMA_BUCKET", "type": "item" }, + { "amount": 512, "id": "ENCHANTED_MITHRIL", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "MITHRIL_INFUSION", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 64, "id": "ENCHANTED_MITHRIL", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_MITHRIL", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_MITHRIL", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_MITHRIL", "type": "item" }, + { "amount": 1, "id": "MAGMA_BUCKET", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_MITHRIL", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_MITHRIL", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_MITHRIL", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_MITHRIL", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "CRYSTAL_FRAGMENT", "type": "item" }, + { "amount": 64, "id": "ENDER_STONE", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "CATALYST", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 8, "id": "ENDER_STONE", "type": "item" }, + { "amount": 8, "id": "ENDER_STONE", "type": "item" }, + { "amount": 8, "id": "ENDER_STONE", "type": "item" }, + { "amount": 8, "id": "ENDER_STONE", "type": "item" }, + { "amount": 1, "id": "CRYSTAL_FRAGMENT", "type": "item" }, + { "amount": 8, "id": "ENDER_STONE", "type": "item" }, + { "amount": 8, "id": "ENDER_STONE", "type": "item" }, + { "amount": 8, "id": "ENDER_STONE", "type": "item" }, + { "amount": 8, "id": "ENDER_STONE", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "HYPER_CATALYST_UPGRADE", "type": "item" }, + { "amount": 8, "id": "CATALYST", "type": "item" } + ], + "outputs": [{ "amount": 8, "id": "HYPER_CATALYST", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 1, "id": "CATALYST", "type": "item" }, + { "amount": 1, "id": "CATALYST", "type": "item" }, + { "amount": 1, "id": "CATALYST", "type": "item" }, + { "amount": 1, "id": "CATALYST", "type": "item" }, + { "amount": 1, "id": "HYPER_CATALYST_UPGRADE", "type": "item" }, + { "amount": 1, "id": "CATALYST", "type": "item" }, + { "amount": 1, "id": "CATALYST", "type": "item" }, + { "amount": 1, "id": "CATALYST", "type": "item" }, + { "amount": 1, "id": "CATALYST", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 576, "id": "CARROT_ITEM", "type": "item" }], + "outputs": [{ "amount": 1, "id": "SIMPLE_CARROT_CANDY", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 160, "id": "CARROT_ITEM", "type": "item" }], + "outputs": [{ "amount": 1, "id": "ENCHANTED_CARROT", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 64, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 32, "id": "CARROT_ITEM", "type": "item" }, + null, + null, + null, + null, + null, + null + ], + "type": "workbench" + }, + { + "grid": [ + null, + { "amount": 32, "id": "CARROT_ITEM", "type": "item" }, + null, + { "amount": 32, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 32, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 32, "id": "CARROT_ITEM", "type": "item" }, + null, + { "amount": 32, "id": "CARROT_ITEM", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 1, "id": "GOLD_INGOT", "type": "item" }], + "outputs": [{ "amount": 9, "id": "GOLD_NUGGET", "type": "item" }], + "place": [ + { + "grid": [ + null, + null, + null, + null, + { "amount": 1, "id": "GOLD_INGOT", "type": "item" }, + null, + null, + null, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 15, "type": "coin" }], + "outputs": [{ "amount": 1, "id": "GOLDEN_CARROT", "type": "item" }], + "place": [{ "id": "ALCHEMIST", "type": "npc" }] + }, + { + "inputs": [ + { "amount": 8, "id": "GOLD_NUGGET", "type": "item" }, + { "amount": 1, "id": "CARROT_ITEM", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "GOLDEN_CARROT", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 1, "id": "GOLD_NUGGET", "type": "item" }, + { "amount": 1, "id": "GOLD_NUGGET", "type": "item" }, + { "amount": 1, "id": "GOLD_NUGGET", "type": "item" }, + { "amount": 1, "id": "GOLD_NUGGET", "type": "item" }, + { "amount": 1, "id": "CARROT_ITEM", "type": "item" }, + { "amount": 1, "id": "GOLD_NUGGET", "type": "item" }, + { "amount": 1, "id": "GOLD_NUGGET", "type": "item" }, + { "amount": 1, "id": "GOLD_NUGGET", "type": "item" }, + { "amount": 1, "id": "GOLD_NUGGET", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 128, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 32, "id": "GOLDEN_CARROT", "type": "item" } + ], + "outputs": [ + { "amount": 1, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" } + ], + "place": [ + { + "grid": [ + null, + { "amount": 32, "id": "ENCHANTED_CARROT", "type": "item" }, + null, + { "amount": 32, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 32, "id": "GOLDEN_CARROT", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_CARROT", "type": "item" }, + null, + { "amount": 32, "id": "ENCHANTED_CARROT", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "SIMPLE_CARROT_CANDY", "type": "item" }, + { "amount": 320, "id": "ENCHANTED_CARROT", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "GREAT_CARROT_CANDY", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 40, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 40, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 40, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 40, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 1, "id": "SIMPLE_CARROT_CANDY", "type": "item" }, + { "amount": 40, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 40, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 40, "id": "ENCHANTED_CARROT", "type": "item" }, + { "amount": 40, "id": "ENCHANTED_CARROT", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "GREAT_CARROT_CANDY", "type": "item" }, + { "amount": 24, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 3, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" }, + { "amount": 3, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" }, + { "amount": 3, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" }, + { "amount": 3, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" }, + { "amount": 1, "id": "GREAT_CARROT_CANDY", "type": "item" }, + { "amount": 3, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" }, + { "amount": 3, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" }, + { "amount": 3, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" }, + { "amount": 3, "id": "ENCHANTED_GOLDEN_CARROT", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 8, "id": "SUPERB_CARROT_CANDY", "type": "item" }, + { "amount": 1, "id": "ULTIMATE_CARROT_CANDY_UPGRADE", "type": "item" } + ], + "outputs": [ + { "amount": 1, "id": "ULTIMATE_CARROT_CANDY", "type": "item" } + ], + "place": [ + { + "grid": [ + { "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" }, + { "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" }, + { "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" }, + { "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" }, + { + "amount": 1, + "id": "ULTIMATE_CARROT_CANDY_UPGRADE", + "type": "item" + }, + { "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" }, + { "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" }, + { "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" }, + { "amount": 1, "id": "SUPERB_CARROT_CANDY", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 160, "id": "INK_SACK:4", "type": "item" }], + "outputs": [ + { "amount": 1, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" } + ], + "place": [ + { + "grid": [ + { "amount": 64, "id": "INK_SACK:4", "type": "item" }, + { "amount": 64, "id": "INK_SACK:4", "type": "item" }, + { "amount": 32, "id": "INK_SACK:4", "type": "item" }, + null, + null, + null, + null, + null, + null + ], + "type": "workbench" + }, + { + "grid": [ + null, + { "amount": 32, "id": "INK_SACK:4", "type": "item" }, + null, + { "amount": 32, "id": "INK_SACK:4", "type": "item" }, + { "amount": 32, "id": "INK_SACK:4", "type": "item" }, + { "amount": 32, "id": "INK_SACK:4", "type": "item" }, + null, + { "amount": 32, "id": "INK_SACK:4", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 160, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" } + ], + "outputs": [ + { "amount": 1, "id": "ENCHANTED_LAPIS_LAZULI_BLOCK", "type": "item" } + ], + "place": [ + { + "grid": [ + { "amount": 64, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" }, + { "amount": 64, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" }, + null, + null, + null, + null, + null, + null + ], + "type": "workbench" + }, + { + "grid": [ + null, + { "amount": 32, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" }, + null, + { "amount": 32, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" }, + null, + { "amount": 32, "id": "ENCHANTED_LAPIS_LAZULI", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 3, "id": "GLASS", "type": "item" }], + "outputs": [{ "amount": 3, "id": "GLASS_BOTTLE", "type": "item" }], + "place": [ + { + "grid": [ + null, + null, + null, + { "amount": 1, "id": "GLASS", "type": "item" }, + null, + { "amount": 1, "id": "GLASS", "type": "item" }, + null, + { "amount": 1, "id": "GLASS", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "GLASS_BOTTLE", "type": "item" }, + { "amount": 6, "id": "ENCHANTED_LAPIS_LAZULI_BLOCK", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "TITANIC_EXP_BOTTLE", "type": "item" }], + "place": [ + { + "grid": [ + null, + { + "amount": 1, + "id": "ENCHANTED_LAPIS_LAZULI_BLOCK", + "type": "item" + }, + null, + { + "amount": 1, + "id": "ENCHANTED_LAPIS_LAZULI_BLOCK", + "type": "item" + }, + { "amount": 1, "id": "GLASS_BOTTLE", "type": "item" }, + { + "amount": 1, + "id": "ENCHANTED_LAPIS_LAZULI_BLOCK", + "type": "item" + }, + { + "amount": 1, + "id": "ENCHANTED_LAPIS_LAZULI_BLOCK", + "type": "item" + }, + { + "amount": 1, + "id": "ENCHANTED_LAPIS_LAZULI_BLOCK", + "type": "item" + }, + { + "amount": 1, + "id": "ENCHANTED_LAPIS_LAZULI_BLOCK", + "type": "item" + } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "COLOSSAL_EXP_BOTTLE_UPGRADE", "type": "item" }, + { "amount": 1, "id": "TITANIC_EXP_BOTTLE", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "COLOSSAL_EXP_BOTTLE", "type": "item" }], + "place": [ + { + "grid": [ + null, + { + "amount": 1, + "id": "COLOSSAL_EXP_BOTTLE_UPGRADE", + "type": "item" + }, + null, + null, + { "amount": 1, "id": "TITANIC_EXP_BOTTLE", "type": "item" }, + null, + null, + null, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 80, "id": "LEATHER", "type": "item" }], + "outputs": [{ "amount": 1, "id": "SMALL_BACKPACK", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 10, "id": "LEATHER", "type": "item" }, + { "amount": 10, "id": "LEATHER", "type": "item" }, + { "amount": 10, "id": "LEATHER", "type": "item" }, + { "amount": 10, "id": "LEATHER", "type": "item" }, + null, + { "amount": 10, "id": "LEATHER", "type": "item" }, + { "amount": 10, "id": "LEATHER", "type": "item" }, + { "amount": 10, "id": "LEATHER", "type": "item" }, + { "amount": 10, "id": "LEATHER", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "SMALL_BACKPACK", "type": "item" }, + { "amount": 512, "id": "LEATHER", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "MEDIUM_BACKPACK", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 1, "id": "SMALL_BACKPACK", "type": "item" }, + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 64, "id": "LEATHER", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 160, "id": "LEATHER", "type": "item" }], + "outputs": [{ "amount": 1, "id": "ENCHANTED_LEATHER", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 64, "id": "LEATHER", "type": "item" }, + { "amount": 32, "id": "LEATHER", "type": "item" }, + null, + null, + null, + null, + null, + null + ], + "type": "workbench" + }, + { + "grid": [ + null, + { "amount": 32, "id": "LEATHER", "type": "item" }, + null, + { "amount": 32, "id": "LEATHER", "type": "item" }, + { "amount": 32, "id": "LEATHER", "type": "item" }, + { "amount": 32, "id": "LEATHER", "type": "item" }, + null, + { "amount": 32, "id": "LEATHER", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "MEDIUM_BACKPACK", "type": "item" }, + { "amount": 16, "id": "ENCHANTED_LEATHER", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "LARGE_BACKPACK", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 2, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 1, "id": "MEDIUM_BACKPACK", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 2, "id": "ENCHANTED_LEATHER", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "LARGE_BACKPACK", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_LEATHER", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "GREATER_BACKPACK", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 4, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 4, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 4, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 4, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 1, "id": "LARGE_BACKPACK", "type": "item" }, + { "amount": 4, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 4, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 4, "id": "ENCHANTED_LEATHER", "type": "item" }, + { "amount": 4, "id": "ENCHANTED_LEATHER", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "JUMBO_BACKPACK_UPGRADE", "type": "item" }, + { "amount": 1, "id": "GREATER_BACKPACK", "type": "item" } + ], + "outputs": [{ "amount": 1, "id": "JUMBO_BACKPACK", "type": "item" }], + "place": [ + { + "grid": [ + null, + { "amount": 1, "id": "JUMBO_BACKPACK_UPGRADE", "type": "item" }, + null, + null, + { "amount": 1, "id": "GREATER_BACKPACK", "type": "item" }, + null, + null, + null, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 64, "id": "LOG", "type": "item" }], + "outputs": [ + { "amount": 1, "id": "SMALL_ENCHANTED_CHEST", "type": "item" } + ], + "place": [ + { + "grid": [ + { "amount": 8, "id": "LOG", "type": "item" }, + { "amount": 8, "id": "LOG", "type": "item" }, + { "amount": 8, "id": "LOG", "type": "item" }, + { "amount": 8, "id": "LOG", "type": "item" }, + null, + { "amount": 8, "id": "LOG", "type": "item" }, + { "amount": 8, "id": "LOG", "type": "item" }, + { "amount": 8, "id": "LOG", "type": "item" }, + { "amount": 8, "id": "LOG", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [{ "amount": 160, "id": "LOG", "type": "item" }], + "outputs": [{ "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" }], + "place": [ + { + "grid": [ + { "amount": 64, "id": "LOG", "type": "item" }, + { "amount": 64, "id": "LOG", "type": "item" }, + { "amount": 32, "id": "LOG", "type": "item" }, + null, + null, + null, + null, + null, + null + ], + "type": "workbench" + }, + { + "grid": [ + null, + { "amount": 32, "id": "LOG", "type": "item" }, + null, + { "amount": 32, "id": "LOG", "type": "item" }, + { "amount": 32, "id": "LOG", "type": "item" }, + { "amount": 32, "id": "LOG", "type": "item" }, + null, + { "amount": 32, "id": "LOG", "type": "item" }, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "SMALL_ENCHANTED_CHEST", "type": "item" }, + { "amount": 8, "id": "ENCHANTED_OAK_LOG", "type": "item" } + ], + "outputs": [ + { "amount": 1, "id": "MEDIUM_ENCHANTED_CHEST", "type": "item" } + ], + "place": [ + { + "grid": [ + { "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 1, "id": "SMALL_ENCHANTED_CHEST", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 1, "id": "ENCHANTED_OAK_LOG", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "MEDIUM_ENCHANTED_CHEST", "type": "item" }, + { "amount": 256, "id": "ENCHANTED_OAK_LOG", "type": "item" } + ], + "outputs": [ + { "amount": 1, "id": "LARGE_ENCHANTED_CHEST", "type": "item" } + ], + "place": [ + { + "grid": [ + { "amount": 32, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 1, "id": "MEDIUM_ENCHANTED_CHEST", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_OAK_LOG", "type": "item" }, + { "amount": 32, "id": "ENCHANTED_OAK_LOG", "type": "item" } + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "MINION_STORAGE_EXPANDER", "type": "item" }, + { "amount": 1, "id": "LARGE_ENCHANTED_CHEST", "type": "item" } + ], + "outputs": [ + { "amount": 1, "id": "XLARGE_ENCHANTED_CHEST", "type": "item" } + ], + "place": [ + { + "grid": [ + null, + { "amount": 1, "id": "MINION_STORAGE_EXPANDER", "type": "item" }, + null, + null, + { "amount": 1, "id": "LARGE_ENCHANTED_CHEST", "type": "item" }, + null, + null, + null, + null + ], + "type": "workbench" + } + ] + }, + { + "inputs": [ + { "amount": 1, "id": "MINION_STORAGE_EXPANDER", "type": "item" }, + { "amount": 1, "id": "XLARGE_ENCHANTED_CHEST", "type": "item" } + ], + "outputs": [ + { "amount": 1, "id": "XXLARGE_ENCHANTED_CHEST", "type": "item" } + ], + "place": [ + { + "grid": [ + null, + { "amount": 1, "id": "MINION_STORAGE_EXPANDER", "type": "item" }, + null, + null, + { "amount": 1, "id": "XLARGE_ENCHANTED_CHEST", "type": "item" }, + null, + null, + null, + null + ], + "type": "workbench" + } + ] + } + ] +} diff --git a/packages/actions/data/bits.json b/packages/actions/data/bits.json new file mode 100644 index 0000000..6f74765 --- /dev/null +++ b/packages/actions/data/bits.json @@ -0,0 +1,350 @@ +{ + "$schema": "./$schema.json", + "actions": [ + { + "inputs": [{ "amount": 1500, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "GOD_POTION_2", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 1350, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "KISMET_FEATHER", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 500, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "KAT_FLOWER", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 2500, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "KAT_BOUQUET", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 3000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "HEAT_CORE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 300, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "HYPER_CATALYST_UPGRADE", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 8000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "ULTIMATE_CARROT_CANDY_UPGRADE", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 1200, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "COLOSSAL_EXP_BOTTLE_UPGRADE", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 4000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "JUMBO_BACKPACK_UPGRADE", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 1500, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "MINION_STORAGE_EXPANDER", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 1200, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "MATRIARCH_PARFUM", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 2000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "HOLOGRAM", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 2000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "DITTO_BLOB", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 12000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "BUILDERS_WAND", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "BLOCK_ZAPPER", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 15000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "BITS_TALISMAN", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 8000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "POCKET_SACK_IN_A_SACK", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 14000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "LARGE_DUNGEON_SACK", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 14000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "RUNE_SACK", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 14000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "FLOWER_SACK", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 14000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "DWARVEN_MINES_SACK", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 14000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "CRYSTAL_HOLLOWS_SACK", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 4800, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "PORTALIZER", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 6450, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "TRIO_CONTACTS_ADDON", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 15000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "ABICASE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 25000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "ABICASE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 26000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "ABICASE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 17000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "ABICASE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 17000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "ABICASE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 17000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "ABICASE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 17000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "ABICASE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 17000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "ABICASE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 21000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "AUTOPET_RULES_2", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 250000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "DYE_PURE_WHITE", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 250000, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "DYE_PURE_BLACK", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 75, "type": "bit" }], + "outputs": [{ "amount": 1, "id": "INFERNO_FUEL_BLOCK", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 3600, "type": "bit" }], + "outputs": [{ "amount": 64, "id": "INFERNO_FUEL_BLOCK", "type": "item" }], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 4000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "ENCHANTMENT_EXPERTISE_1", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 4000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "ENCHANTMENT_COMPACT_1", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 4000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "ENCHANTMENT_CULTIVATING_1", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 4000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "ENCHANTMENT_CHAMPION_1", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 6000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "ENCHANTMENT_HECATOMB_1", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 4000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "ENCHANTMENT_TOXOPHILITE_1", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { + "amount": 1, + "id": "TALISMAN_ENRICHMENT_ATTACK_SPEED", + "type": "item" + } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { + "amount": 1, + "id": "TALISMAN_ENRICHMENT_CRITICAL_CHANCE", + "type": "item" + } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { + "amount": 1, + "id": "TALISMAN_ENRICHMENT_CRITICAL_DAMAGE", + "type": "item" + } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "TALISMAN_ENRICHMENT_DEFENSE", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "TALISMAN_ENRICHMENT_FEROCITY", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "TALISMAN_ENRICHMENT_HEALTH", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { + "amount": 1, + "id": "TALISMAN_ENRICHMENT_INTELLIGENCE", + "type": "item" + } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "TALISMAN_ENRICHMENT_MAGIC_FIND", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { + "amount": 1, + "id": "TALISMAN_ENRICHMENT_SEA_CREATURE_CHANCE", + "type": "item" + } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "TALISMAN_ENRICHMENT_STRENGTH", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 5000, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "TALISMAN_ENRICHMENT_WALK_SPEED", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + }, + { + "inputs": [{ "amount": 200, "type": "bit" }], + "outputs": [ + { "amount": 1, "id": "TALISMAN_ENRICHMENT_SWAPPER", "type": "item" } + ], + "place": [{ "id": "ELIZABETH", "type": "npc" }] + } + ] +} diff --git a/packages/actions/package.json b/packages/actions/package.json new file mode 100644 index 0000000..fb875b1 --- /dev/null +++ b/packages/actions/package.json @@ -0,0 +1,45 @@ +{ + "bugs": { + "url": "https://github.com/skyblock-finance/skyblock-finance-opensource/issues" + }, + "dependencies": { + "zod": "^3.23.8" + }, + "devDependencies": { + "@types/bun": "latest" + }, + "files": [ + "dist", + "source" + ], + "keywords": [ + "hypixel-skyblock", + "hypixel", + "skyblock-finance" + ], + "license": "MIT", + "main": "dist/index.js", + "name": "@skyblock-finance/actions", + "peerDependencies": { + "typescript": ">= 4" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/skyblock-finance/skyblock-finance-opensource" + }, + "scripts": { + "build": "rm -rf dist && tsc --build", + "check:arethetypeswrong": "bun run attw --pack .", + "check:eslint": "bun run eslint --max-warnings=0 .", + "check:prettier": "bun --bun run --cwd ../.. prettier --check packages/actions", + "check:publint": "bun --bun run publint", + "fix:eslint": "bun run check:eslint --fix", + "fix:prettier": "bun --bun run check:prettier --write", + "publish-package": "npm publish --access public --provenance", + "test": "bun test" + }, + "sideEffects": false, + "type": "commonjs", + "types": "dist/index.d.ts", + "version": "0.0.1" +} diff --git a/packages/actions/source/data.test.ts b/packages/actions/source/data.test.ts new file mode 100644 index 0000000..1255bcd --- /dev/null +++ b/packages/actions/source/data.test.ts @@ -0,0 +1,88 @@ +import { ActionIoItem, actionSchema } from './schema' +import { allActions } from './data' +import { z } from 'zod' +import { describe, expect, test } from 'bun:test' +import assert from 'node:assert' + +test('all actions follow the schema', () => { + expect(() => z.array(actionSchema).parse(allActions)).not.toThrow() +}) + +describe('every action’s inputs match its outputs', () => { + /** + * Simplifies and "sorts" action input/output items + */ + const sumUp = (ios: ActionIoItem[]): Map => { + const result = new Map() + + for (const io of ios) { + const previousValue = result.get(io.id) ?? 0 + result.set(io.id, previousValue + io.amount) + } + + return result + } + + test('sumUp works', () => { + expect( + sumUp([ + { + amount: 1, + id: 'FOO', + type: 'item', + }, + { + amount: 2, + id: 'BAR', + type: 'item', + }, + { + amount: 1, + id: 'BAZ', + type: 'item', + }, + ]), + ).toEqual( + sumUp([ + { + amount: 1, + id: 'BAR', + type: 'item', + }, + { + amount: 1, + id: 'FOO', + type: 'item', + }, + { + amount: 1, + id: 'BAZ', + type: 'item', + }, + { + amount: 1, + id: 'BAR', + type: 'item', + }, + ]), + ) + }) + + for (const action of allActions) { + for (const grid of action.place.filter((x) => x.type === 'workbench')) { + test(`${JSON.stringify(action.outputs)} is valid`, () => { + assert(grid.type === 'workbench') + + const actual = sumUp( + action.inputs.filter((x) => x.type === 'item') as ActionIoItem[], + ) + + const expected = sumUp( + grid.grid.filter((x) => x !== null) as ActionIoItem[], + ) + + expect(actual).toEqual(expected) + }) + } + } +}) diff --git a/packages/actions/source/data.ts b/packages/actions/source/data.ts new file mode 100644 index 0000000..d345585 --- /dev/null +++ b/packages/actions/source/data.ts @@ -0,0 +1,8 @@ +import { actions as _bits } from '../data/bits.json' +import { actions as _bitsCrafts } from '../data/bits-crafts.json' +import { Action } from './schema' + +export const bits = _bits as Action[] +export const bitsCrafts = _bitsCrafts as Action[] + +export const allActions = [...bits, ...bitsCrafts] diff --git a/packages/actions/source/index.ts b/packages/actions/source/index.ts new file mode 100644 index 0000000..a4c57a6 --- /dev/null +++ b/packages/actions/source/index.ts @@ -0,0 +1,2 @@ +export * from './data' +export * from './schema' diff --git a/packages/actions/source/schema.ts b/packages/actions/source/schema.ts new file mode 100644 index 0000000..f34d24f --- /dev/null +++ b/packages/actions/source/schema.ts @@ -0,0 +1,54 @@ +import { z } from 'zod' + +export const actionIoItemSchema = z + .object({ + amount: z.number().int().finite(), + id: z.string(), + type: z.literal('item'), + }) + .strict() + +export type ActionIoItem = z.output + +export const actionIoSchema = z.discriminatedUnion('type', [ + z + .object({ + amount: z.number().int().finite(), + type: z.literal('bit'), + }) + .strict(), + z + .object({ + amount: z.number().int().finite(), + type: z.literal('coin'), + }) + .strict(), + actionIoItemSchema, +]) + +export type ActionIo = z.output + +export const actionPlaceSchema = z.discriminatedUnion('type', [ + z + .object({ + id: z.string(), + type: z.literal('npc'), + }) + .strict(), + z + .object({ + grid: z.array(actionIoItemSchema.nullable()).length(9), + type: z.literal('workbench'), + }) + .strict(), +]) + +export const actionSchema = z + .object({ + inputs: z.array(actionIoSchema), + outputs: z.array(actionIoSchema), + place: z.array(actionPlaceSchema), + }) + .strict() + +export type Action = z.output diff --git a/packages/actions/tsconfig.json b/packages/actions/tsconfig.json new file mode 100644 index 0000000..c8bd326 --- /dev/null +++ b/packages/actions/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "module": "commonjs", + "moduleResolution": "Node", + "outDir": "./dist", + "rootDir": "./source", + "tsBuildInfoFile": "./dist/.tsbuildinfo", + "types": ["bun"] + }, + "exclude": ["source/**/*.test.ts"], + "extends": "../../tsconfig.json", + "include": ["source/**/*.ts"] +} diff --git a/packages/actions/turbo.json b/packages/actions/turbo.json new file mode 100644 index 0000000..e085ed6 --- /dev/null +++ b/packages/actions/turbo.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://turbo.build/schema.v1.json", + "extends": ["//"], + "pipeline": {} +} diff --git a/packages/schemas/turbo.json b/packages/schemas/turbo.json index 19e716f..69225f7 100644 --- a/packages/schemas/turbo.json +++ b/packages/schemas/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turbo.build/schema.json", + "$schema": "https://turbo.build/schema.v1.json", "extends": ["//"], "pipeline": { "download": { diff --git a/turbo.json b/turbo.json index 57d7e73..aecc4ac 100644 --- a/turbo.json +++ b/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turbo.build/schema.json", + "$schema": "https://turbo.build/schema.v1.json", "globalDependencies": ["bun.lockb"], "pipeline": { "build": { @@ -65,6 +65,8 @@ "cache": false, "dependsOn": ["build", "check", "test"] }, - "test": {} + "test": { + "outputMode": "new-only" + } } }