{"_id":"@2bttns/objects","name":"@2bttns/objects","dist-tags":{"latest":"1.2.5"},"versions":{"1.2.5":{"name":"@2bttns/objects","version":"1.2.5","description":"Convert JSON data into a format readable by the 2bttns Console.","main":"./formatter.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","start":"node ./formatter.js completion:install","build":"tsc formatter.ts"},"bin":{"game-objects-converter":"formatter.js"},"author":{"name":"2bttns Company"},"license":"MIT","dependencies":{"@types/node":"^20.3.2","cuid":"^3.0.0","enquirer":"^2.3.6","glob":"^10.3.3","omelette":"^0.4.17","typescript":"^5.1.6"},"devDependencies":{"ts-node":"^10.9.1","ts-node-dev":"^2.0.0"},"gitHead":"3a3620fd1fe52b609a9576aa91a464137fda2a24","_id":"@2bttns/objects@1.2.5","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-sCUlI4CcWM2ca1Kx6VQvrildjdabV8hk7sUuPg1Hn04l/yXAdsRK1HqZecR8hf/HwWsg0SUfjOjcoR1gLKNhJA==","shasum":"69bc42538bd3da686c971f915fc85f12a4f6b6a6","tarball":"https://registry.npmjs.org/@2bttns/objects/-/objects-1.2.5.tgz","fileCount":19,"unpackedSize":51368,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEv7xdz4w6C0Fryj/ORvIPiiKI/E2f65Wfthpje154m1AiEA1tBdGSmROtU03THsesknzr4S6DyM+kYEZqvlWVyJ58Q="}]},"_npmUser":{"name":"mriziq","email":"amer@2bttns.com"},"directories":{},"maintainers":[{"name":"mriziq","email":"amer@2bttns.com"},{"name":"mat-2bttns","email":"mat@2bttns.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/objects_1.2.5_1690878881245_0.5368208271625214"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-01T08:34:41.189Z","1.2.5":"2023-08-01T08:34:41.414Z","modified":"2023-08-01T08:34:41.578Z"},"maintainers":[{"name":"mriziq","email":"amer@2bttns.com"},{"name":"mat-2bttns","email":"mat@2bttns.com"}],"description":"Convert JSON data into a format readable by the 2bttns Console.","author":{"name":"2bttns Company"},"license":"MIT","readme":"# Format & Get Ready Data\nConvert JSON data into a format readable by the 2bttns Console.\n\n## Usage \n\n   ```bash\n   npx @2bttns/objects\n   ```\n  \n```Format data for 2bttns Console``` will guide you through mapping your JSON and generating a ready to upload file.\n\n```Get ready-to-upload json data``` will download already formatted Game Objects available in the formatter.\n\n```bash\n# Ready to upload json data\n? Select the JSON file you want to output from the /formatted-data folder: … \n❯ ready-car-considerations.json\n  ready-chords.json\n  ready-indoorActivities.json\n  ready-outdoorActivities.json\n\n```\n\n## Table of Contents\n1. [Data Model](#game-objects-model)\n2. [Usage](#usage)\n3. [Example](#example)\n4. [Upload to Console](#upload-to-console)\n5. [License](#license)\n\n\n---\n\n\n#### Warnin\n> The Tags section at the bottom of the output JSON is currently set to have empty strings for `id`, `name`, and `description` fields. <br/> As a result, a new Tag object will be generated in the Console.\n\n\n## Game Objects Model\nThe script converts any size JSON into the data model below. \n\n> Your JSON must contain a `name` equivalent field. These values are loaded as choices within your Game buttons.\n>\n> Fields not represented in the Game Objects model are ignored. See [Example](#example) for more information.\n\n```typescript\nconst outputShape: OutputShape = {\n  gameObjects: [\n    {\n      id: '',\n      name: '',\n      description: '',\n      tagIds: []\n    }\n  ],\n  tags: [\n    {\n      id: '',\n      name: '',\n      description: ''\n    }\n  ]\n};\n```\n\nInterface Type\n```typescript\ninterface GameObject {\n  id: string;\n  name: string;\n  description: string;\n  tagIds: string[];\n  [key: string]: any;\n}\n```\n\n## Example\n\nHere's an example of the input JSON:\n\n```json\n{\n    \"chords\": [\n      {\n        \"name\": \"C Major\",\n        \"notes\": [\"C\", \"E\", \"G\"]\n      },\n      {\n        \"name\": \"C Minor\",\n        \"notes\": [\"C\", \"Eb\", \"G\"]\n      },\n      {\n        \"name\": \"D Major\",\n        \"notes\": [\"D\", \"F#\", \"A\"]\n      },\n      ...\n    ]\n}\n```\n\nAnd here's the resulting output JSON:\n\n```json\n{\n  \"gameObjects\": [\n    {\n      \"id\": \"cljgvm1w00000679s2l9a5zql\",\n      \"name\": \"C Major\",\n      \"description\": \"\",\n      \"tagIds\": []\n    },\n    {\n      \"id\": \"cljgvm1w10001679sdppzbk1p\",\n      \"name\": \"C Minor\",\n      \"description\": \"\",\n      \"tagIds\": []\n    },\n    {\n      \"id\": \"cljgvm1w10002679sda2j6i75\",\n      \"name\": \"D Major\",\n      \"description\": \"\",\n      \"tagIds\": []\n    },\n    ...\n  ],\n  \"tags\": [\n    {\n      \"id\": \"\",\n      \"name\": \"\",\n      \"description\": \"\"\n    }\n  ]\n}\n```\n\n## Upload to Console\n\nNow your new json is ready to be uploaded.\n\n1. Locate your converted data.\n2. Open your Console\n3. Navigate to Objects\n4. Click Actions then Import from JSON\n5. Upload the `ready-for-upload.json` file and click Confirm.\n\nYour Game Objects are now ready to be Tagged!\n\n## License\n\nThis project is licensed under the [MIT License](/MIT_LICENSE.txt).\n","readmeFilename":"README.md"}