diff --git a/README.md b/README.md index 41b0a98..e2c5f98 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,5 @@ # SPT Items -* You can use either of the two drone pipeline types: - * [docker](.drone-docker.yml) - * [kubernetes](.drone-kubernetes.yml) -* Some enhancement ideas can be found [here](#some-enhancement-ideas) - ## Required secrets | secret name | description | example | | :----------------- | :---------- | :------- | @@ -30,7 +25,13 @@ 1. Nginx must be configured to use HTTPS 1. Nginx must be configured to listen to *spt_items_hostname* and to point to the *deploy_path* + ## The pipeline summary +* You can use either of the two drone pipeline types: + * [docker](.drone-docker.yml) + * [kubernetes](.drone-kubernetes.yml) +* Some enhancement ideas can be found [here](#some-enhancement-ideas) + 1. Each push will: 1. Test the frontend 2. IF on `development` or `master`/`main` branch @@ -44,4 +45,7 @@ see [Walkthrough.md](./docs/Walkthrough.md) ## Some enhancement ideas - Store the build so that it is not rebuilt on any `promote` event -- Use a volume or a cache for Yarn install \ No newline at end of file +- Use a volume or a cache for Yarn install + +## Thanks +- CWX \ No newline at end of file diff --git a/docs/Singleplayer-Tarkov-Items.postman_collection.json b/docs/Singleplayer-Tarkov-Items.postman_collection.json new file mode 100644 index 0000000..96a2136 --- /dev/null +++ b/docs/Singleplayer-Tarkov-Items.postman_collection.json @@ -0,0 +1,3255 @@ +{ + "info": { + "_postman_id": "9901d119-c259-4502-af52-588e6084f007", + "name": "Singleplayer-Tarkov-Items", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "3974453" + }, + "item": [ + { + "name": "Local", + "item": [ + { + "name": "Default locale", + "item": [ + { + "name": "Get item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item?id=5734773724597737fd047c14", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk by ID", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n \"_name\": \"condensed_milk\",\n \"_parent\": \"5448e8d04bdc2ddf718b4569\",\n \"_props\": {\n \"AllowSpawnOnLocations\": [],\n \"AnimationVariantsNumber\": 0,\n \"BackgroundColor\": \"orange\",\n \"CanRequireOnRagfair\": true,\n \"CanSellOnRagfair\": true,\n \"ChangePriceCoef\": 1,\n \"ConflictingItems\": [],\n \"CreditsPrice\": 24943,\n \"Description\": \"Condensed milk\",\n \"DiscardingBlock\": false,\n \"ExamineExperience\": 20,\n \"ExamineTime\": 1,\n \"ExaminedByDefault\": false,\n \"ExtraSizeDown\": 0,\n \"ExtraSizeForceAdd\": false,\n \"ExtraSizeLeft\": 0,\n \"ExtraSizeRight\": 0,\n \"ExtraSizeUp\": 0,\n \"FixedPrice\": false,\n \"Height\": 1,\n \"HideEntrails\": false,\n \"IsAlwaysAvailableForInsurance\": false,\n \"IsLockedafterEquip\": false,\n \"IsUnbuyable\": false,\n \"IsUndiscardable\": false,\n \"IsUngivable\": false,\n \"IsUnsaleable\": false,\n \"ItemSound\": \"food_tin_can\",\n \"LootExperience\": 50,\n \"MaxResource\": 1,\n \"MergesWithChildren\": false,\n \"Name\": \"Condensed milk\",\n \"NotShownInSlot\": false,\n \"Prefab\": {\n \"path\": \"assets/content/weapons/usable_items/item_food_condensed_milk/item_food_condensed_milk_loot.bundle\",\n \"rcid\": \"\"\n },\n \"QuestItem\": false,\n \"RagFairCommissionModifier\": 1,\n \"Rarity\": \"Rare\",\n \"RepairCost\": 0,\n \"RepairSpeed\": 0,\n \"SendToClient\": false,\n \"ShortName\": \"Condensed milk\",\n \"SpawnChance\": 9,\n \"StackMaxSize\": 1,\n \"StackObjectsCount\": 1,\n \"StimulatorBuffs\": \"Buffs_food_condensed_milk\",\n \"Unlootable\": false,\n \"UnlootableFromSide\": [],\n \"UnlootableFromSlot\": \"FirstPrimaryWeapon\",\n \"UsePrefab\": {\n \"path\": \"assets/content/weapons/usable_items/item_food_condensed_milk/item_food_condensed_milk_container.bundle\",\n \"rcid\": \"\"\n },\n \"Weight\": 0.4,\n \"Width\": 1,\n \"effects_damage\": [],\n \"effects_health\": {\n \"Energy\": {\n \"value\": 75\n },\n \"Hydration\": {\n \"value\": -65\n }\n },\n \"foodEffectType\": \"afterUse\",\n \"foodUseTime\": 4\n },\n \"_proto\": \"5734770f24597738025ee254\",\n \"_type\": \"Item\"\n },\n \"locale\": {\n \"Description\": \"Condensed milk, also called \\\"Sguschyonka\\\" in Russia, once was a part of field ration for the Union soldiers in Civil War, but later reached unprecedented popularity in post-Soviet countries, becoming almost a staple product. Canned, it can be stored for decades and remain just as sweet, tasty and nutritious.\",\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n}" + } + ] + }, + { + "name": "Get item Name by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Can of condensed milk');\r", + "});\r", + "\r", + "pm.test('Item short name is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.ShortName).to.eql('Cond. milk');\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/nameByID?id=5734773724597737fd047c14", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "nameByID" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk by ID", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n },\n \"locale\": {\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n}" + } + ] + }, + { + "name": "Get item Names", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Returns more than one result', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData).length.to.greaterThan(0);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/names", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "names" + ] + } + }, + "response": [ + { + "name": "Get Item Names", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "[\n {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n },\n \"locale\": {\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n }\n]" + } + ] + }, + { + "name": "Get item hierarchy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].item._id).to.eql(id);\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].locale.Name).to.eql('Can of condensed milk');\r", + "});\r", + "\r", + "pm.test('Check we get all the hierarchy', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(Object.keys(jsonData).length).to.eql(4);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/hierarchy?id=5734773724597737fd047c14", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "hierarchy" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk hierarchy", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"5734773724597737fd047c14\": {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n \"_name\": \"condensed_milk\",\n \"_parent\": \"5448e8d04bdc2ddf718b4569\"\n },\n \"locale\": {\n \"Description\": \"Condensed milk, also called \\\"Sguschyonka\\\" in Russia, once was a part of field ration for the Union soldiers in Civil War, but later reached unprecedented popularity in post-Soviet countries, becoming almost a staple product. Canned, it can be stored for decades and remain just as sweet, tasty and nutritious.\",\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n },\n \"5448e8d04bdc2ddf718b4569\": {\n \"item\": {\n \"_id\": \"5448e8d04bdc2ddf718b4569\",\n \"_name\": \"Food\",\n \"_parent\": \"543be6674bdc2df1348b4569\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food\",\n \"ShortName\": \"Item\"\n }\n },\n \"543be6674bdc2df1348b4569\": {\n \"item\": {\n \"_id\": \"543be6674bdc2df1348b4569\",\n \"_name\": \"FoodDrink\",\n \"_parent\": \"54009119af1c881c07000029\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food and drink\",\n \"ShortName\": \"Item\"\n }\n },\n \"54009119af1c881c07000029\": {\n \"item\": {\n \"_id\": \"54009119af1c881c07000029\",\n \"_name\": \"Item\",\n \"_parent\": \"\"\n },\n \"locale\": \"\"\n }\n}" + } + ] + }, + { + "name": "Search item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"5734773724597737fd047c14\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by Name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Condensed milk\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search Milk by internal name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"condensed_milk\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by ShortName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Cond. milk\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "English locale", + "item": [ + { + "name": "Get item Name by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Can of condensed milk');\r", + "});\r", + "\r", + "pm.test('Item short name is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.ShortName).to.eql('Cond. milk');\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/nameByID?id=5734773724597737fd047c14&locale={{LOCALE}}", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "nameByID" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "{{LOCALE}}" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk by ID", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n },\n \"locale\": {\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n}" + } + ] + }, + { + "name": "Get item Names", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Returns more than one result', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData).length.to.greaterThan(0);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/names?locale={{LOCALE}}", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "names" + ], + "query": [ + { + "key": "locale", + "value": "{{LOCALE}}" + } + ] + } + }, + "response": [ + { + "name": "Get Item Names", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "[\n {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n },\n \"locale\": {\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n }\n]" + } + ] + }, + { + "name": "Get item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item?id=5734773724597737fd047c14&locale={{LOCALE}}", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "{{LOCALE}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get item hierarchy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].item._id).to.eql(id);\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].locale.Name).to.eql('Can of condensed milk');\r", + "});\r", + "\r", + "pm.test('Check we get all the hierarchy', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(Object.keys(jsonData).length).to.eql(4);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/hierarchy?id=5734773724597737fd047c14&locale=en", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "hierarchy" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "en" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk hierarchy", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"5734773724597737fd047c14\": {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n \"_name\": \"condensed_milk\",\n \"_parent\": \"5448e8d04bdc2ddf718b4569\"\n },\n \"locale\": {\n \"Description\": \"Condensed milk, also called \\\"Sguschyonka\\\" in Russia, once was a part of field ration for the Union soldiers in Civil War, but later reached unprecedented popularity in post-Soviet countries, becoming almost a staple product. Canned, it can be stored for decades and remain just as sweet, tasty and nutritious.\",\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n },\n \"5448e8d04bdc2ddf718b4569\": {\n \"item\": {\n \"_id\": \"5448e8d04bdc2ddf718b4569\",\n \"_name\": \"Food\",\n \"_parent\": \"543be6674bdc2df1348b4569\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food\",\n \"ShortName\": \"Item\"\n }\n },\n \"543be6674bdc2df1348b4569\": {\n \"item\": {\n \"_id\": \"543be6674bdc2df1348b4569\",\n \"_name\": \"FoodDrink\",\n \"_parent\": \"54009119af1c881c07000029\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food and drink\",\n \"ShortName\": \"Item\"\n }\n },\n \"54009119af1c881c07000029\": {\n \"item\": {\n \"_id\": \"54009119af1c881c07000029\",\n \"_name\": \"Item\",\n \"_parent\": \"\"\n },\n \"locale\": \"\"\n }\n}" + } + ] + }, + { + "name": "Search item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"5734773724597737fd047c14\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by Name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Condensed milk\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search Milk by internal name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"condensed_milk\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by ShortName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Can of condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Cond. milk\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "pm.environment.set(\"LOCALE\", \"en\");" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "French locale", + "item": [ + { + "name": "Get item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item?id=5734773724597737fd047c14&locale={{LOCALE}}", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "{{LOCALE}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get item hierarchy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].item._id).to.eql(id);\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].locale.Name).to.eql('Conserve de lait concentré');\r", + "});\r", + "\r", + "pm.test('Check we get all the hierarchy', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(Object.keys(jsonData).length).to.eql(4);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/hierarchy?id=5734773724597737fd047c14&locale=fr", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "hierarchy" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "fr" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk hierarchy", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"5734773724597737fd047c14\": {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n \"_name\": \"condensed_milk\",\n \"_parent\": \"5448e8d04bdc2ddf718b4569\"\n },\n \"locale\": {\n \"Description\": \"Condensed milk, also called \\\"Sguschyonka\\\" in Russia, once was a part of field ration for the Union soldiers in Civil War, but later reached unprecedented popularity in post-Soviet countries, becoming almost a staple product. Canned, it can be stored for decades and remain just as sweet, tasty and nutritious.\",\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n },\n \"5448e8d04bdc2ddf718b4569\": {\n \"item\": {\n \"_id\": \"5448e8d04bdc2ddf718b4569\",\n \"_name\": \"Food\",\n \"_parent\": \"543be6674bdc2df1348b4569\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food\",\n \"ShortName\": \"Item\"\n }\n },\n \"543be6674bdc2df1348b4569\": {\n \"item\": {\n \"_id\": \"543be6674bdc2df1348b4569\",\n \"_name\": \"FoodDrink\",\n \"_parent\": \"54009119af1c881c07000029\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food and drink\",\n \"ShortName\": \"Item\"\n }\n },\n \"54009119af1c881c07000029\": {\n \"item\": {\n \"_id\": \"54009119af1c881c07000029\",\n \"_name\": \"Item\",\n \"_parent\": \"\"\n },\n \"locale\": \"\"\n }\n}" + } + ] + }, + { + "name": "Search item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"5734773724597737fd047c14\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by Name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Lait concentré\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search Milk by internal name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"condensed_milk\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by ShortName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Lait conc.\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Get item Name by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Conserve de lait concentré');\r", + "});\r", + "\r", + "pm.test('Item short name is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.ShortName).to.eql('Lait conc.');\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/nameByID?id=5734773724597737fd047c14&locale={{LOCALE}}", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "nameByID" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "{{LOCALE}}" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk by ID", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n },\n \"locale\": {\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n}" + } + ] + }, + { + "name": "Get item Names", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Returns more than one result', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData).length.to.greaterThan(0);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/names?locale={{LOCALE}}", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "names" + ], + "query": [ + { + "key": "locale", + "value": "{{LOCALE}}" + } + ] + } + }, + "response": [ + { + "name": "Get Item Names", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "[\n {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n },\n \"locale\": {\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n }\n]" + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "pm.environment.set(\"LOCALE\", \"fr\");" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "RefreshAll", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.expect(pm.response.code).to.be.oneOf([200,204]);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/refresh", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "refresh" + ] + } + }, + "response": [] + }, + { + "name": "Get all locales", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('At least one locale is present', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData).length.greaterThan(0);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/locales/", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "locales", + "" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "pm.environment.set(\"SPT_API\", \"http://localhost:8000\");" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Deployed", + "item": [ + { + "name": "Default locale", + "item": [ + { + "name": "Get item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item?id=5734773724597737fd047c14", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk by ID", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n \"_name\": \"condensed_milk\",\n \"_parent\": \"5448e8d04bdc2ddf718b4569\",\n \"_props\": {\n \"AllowSpawnOnLocations\": [],\n \"AnimationVariantsNumber\": 0,\n \"BackgroundColor\": \"orange\",\n \"CanRequireOnRagfair\": true,\n \"CanSellOnRagfair\": true,\n \"ChangePriceCoef\": 1,\n \"ConflictingItems\": [],\n \"CreditsPrice\": 24943,\n \"Description\": \"Condensed milk\",\n \"DiscardingBlock\": false,\n \"ExamineExperience\": 20,\n \"ExamineTime\": 1,\n \"ExaminedByDefault\": false,\n \"ExtraSizeDown\": 0,\n \"ExtraSizeForceAdd\": false,\n \"ExtraSizeLeft\": 0,\n \"ExtraSizeRight\": 0,\n \"ExtraSizeUp\": 0,\n \"FixedPrice\": false,\n \"Height\": 1,\n \"HideEntrails\": false,\n \"IsAlwaysAvailableForInsurance\": false,\n \"IsLockedafterEquip\": false,\n \"IsUnbuyable\": false,\n \"IsUndiscardable\": false,\n \"IsUngivable\": false,\n \"IsUnsaleable\": false,\n \"ItemSound\": \"food_tin_can\",\n \"LootExperience\": 50,\n \"MaxResource\": 1,\n \"MergesWithChildren\": false,\n \"Name\": \"Condensed milk\",\n \"NotShownInSlot\": false,\n \"Prefab\": {\n \"path\": \"assets/content/weapons/usable_items/item_food_condensed_milk/item_food_condensed_milk_loot.bundle\",\n \"rcid\": \"\"\n },\n \"QuestItem\": false,\n \"RagFairCommissionModifier\": 1,\n \"Rarity\": \"Rare\",\n \"RepairCost\": 0,\n \"RepairSpeed\": 0,\n \"SendToClient\": false,\n \"ShortName\": \"Condensed milk\",\n \"SpawnChance\": 9,\n \"StackMaxSize\": 1,\n \"StackObjectsCount\": 1,\n \"StimulatorBuffs\": \"Buffs_food_condensed_milk\",\n \"Unlootable\": false,\n \"UnlootableFromSide\": [],\n \"UnlootableFromSlot\": \"FirstPrimaryWeapon\",\n \"UsePrefab\": {\n \"path\": \"assets/content/weapons/usable_items/item_food_condensed_milk/item_food_condensed_milk_container.bundle\",\n \"rcid\": \"\"\n },\n \"Weight\": 0.4,\n \"Width\": 1,\n \"effects_damage\": [],\n \"effects_health\": {\n \"Energy\": {\n \"value\": 75\n },\n \"Hydration\": {\n \"value\": -65\n }\n },\n \"foodEffectType\": \"afterUse\",\n \"foodUseTime\": 4\n },\n \"_proto\": \"5734770f24597738025ee254\",\n \"_type\": \"Item\"\n },\n \"locale\": {\n \"Description\": \"Condensed milk, also called \\\"Sguschyonka\\\" in Russia, once was a part of field ration for the Union soldiers in Civil War, but later reached unprecedented popularity in post-Soviet countries, becoming almost a staple product. Canned, it can be stored for decades and remain just as sweet, tasty and nutritious.\",\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n}" + } + ] + }, + { + "name": "Get item hierarchy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].item._id).to.eql(id);\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].locale.Name).to.eql('Condensed milk');\r", + "});\r", + "\r", + "pm.test('Check we get all the hierarchy', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(Object.keys(jsonData).length).to.eql(4);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/hierarchy?id=5734773724597737fd047c14", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "hierarchy" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk hierarchy", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"5734773724597737fd047c14\": {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n \"_name\": \"condensed_milk\",\n \"_parent\": \"5448e8d04bdc2ddf718b4569\"\n },\n \"locale\": {\n \"Description\": \"Condensed milk, also called \\\"Sguschyonka\\\" in Russia, once was a part of field ration for the Union soldiers in Civil War, but later reached unprecedented popularity in post-Soviet countries, becoming almost a staple product. Canned, it can be stored for decades and remain just as sweet, tasty and nutritious.\",\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n },\n \"5448e8d04bdc2ddf718b4569\": {\n \"item\": {\n \"_id\": \"5448e8d04bdc2ddf718b4569\",\n \"_name\": \"Food\",\n \"_parent\": \"543be6674bdc2df1348b4569\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food\",\n \"ShortName\": \"Item\"\n }\n },\n \"543be6674bdc2df1348b4569\": {\n \"item\": {\n \"_id\": \"543be6674bdc2df1348b4569\",\n \"_name\": \"FoodDrink\",\n \"_parent\": \"54009119af1c881c07000029\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food and drink\",\n \"ShortName\": \"Item\"\n }\n },\n \"54009119af1c881c07000029\": {\n \"item\": {\n \"_id\": \"54009119af1c881c07000029\",\n \"_name\": \"Item\",\n \"_parent\": \"\"\n },\n \"locale\": \"\"\n }\n}" + } + ] + }, + { + "name": "Search item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"5734773724597737fd047c14\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by Name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Condensed milk\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search Milk by internal name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"condensed_milk\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by ShortName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Cond. milk\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "English locale", + "item": [ + { + "name": "Get item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item?id=5734773724597737fd047c14&locale={{LOCALE}}", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "{{LOCALE}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get item hierarchy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].item._id).to.eql(id);\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].locale.Name).to.eql('Condensed milk');\r", + "});\r", + "\r", + "pm.test('Check we get all the hierarchy', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(Object.keys(jsonData).length).to.eql(4);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/hierarchy?id=5734773724597737fd047c14&locale=en", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "hierarchy" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "en" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk hierarchy", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"5734773724597737fd047c14\": {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n \"_name\": \"condensed_milk\",\n \"_parent\": \"5448e8d04bdc2ddf718b4569\"\n },\n \"locale\": {\n \"Description\": \"Condensed milk, also called \\\"Sguschyonka\\\" in Russia, once was a part of field ration for the Union soldiers in Civil War, but later reached unprecedented popularity in post-Soviet countries, becoming almost a staple product. Canned, it can be stored for decades and remain just as sweet, tasty and nutritious.\",\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n },\n \"5448e8d04bdc2ddf718b4569\": {\n \"item\": {\n \"_id\": \"5448e8d04bdc2ddf718b4569\",\n \"_name\": \"Food\",\n \"_parent\": \"543be6674bdc2df1348b4569\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food\",\n \"ShortName\": \"Item\"\n }\n },\n \"543be6674bdc2df1348b4569\": {\n \"item\": {\n \"_id\": \"543be6674bdc2df1348b4569\",\n \"_name\": \"FoodDrink\",\n \"_parent\": \"54009119af1c881c07000029\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food and drink\",\n \"ShortName\": \"Item\"\n }\n },\n \"54009119af1c881c07000029\": {\n \"item\": {\n \"_id\": \"54009119af1c881c07000029\",\n \"_name\": \"Item\",\n \"_parent\": \"\"\n },\n \"locale\": \"\"\n }\n}" + } + ] + }, + { + "name": "Search item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"5734773724597737fd047c14\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by Name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Condensed milk\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search Milk by internal name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"condensed_milk\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by ShortName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Condensed milk');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Cond. milk\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "pm.environment.set(\"LOCALE\", \"en\");" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "French locale", + "item": [ + { + "name": "Get item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item?id=5734773724597737fd047c14&locale={{LOCALE}}", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "{{LOCALE}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get item hierarchy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].item._id).to.eql(id);\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " var id = pm.request.toJSON().url.query[0].value;\r", + " pm.expect(jsonData[id].locale.Name).to.eql('Conserve de lait concentré');\r", + "});\r", + "\r", + "pm.test('Check we get all the hierarchy', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(Object.keys(jsonData).length).to.eql(4);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/item/hierarchy?id=5734773724597737fd047c14&locale=fr", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "hierarchy" + ], + "query": [ + { + "key": "id", + "value": "5734773724597737fd047c14" + }, + { + "key": "locale", + "value": "fr" + } + ] + } + }, + "response": [ + { + "name": "Get Condensed Milk hierarchy", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{SPT_API}}/api/item/5734773724597737fd047c14", + "protocol": "http", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "item", + "5734773724597737fd047c14" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": null, + "cookie": [], + "body": "{\n \"5734773724597737fd047c14\": {\n \"item\": {\n \"_id\": \"5734773724597737fd047c14\",\n \"_name\": \"condensed_milk\",\n \"_parent\": \"5448e8d04bdc2ddf718b4569\"\n },\n \"locale\": {\n \"Description\": \"Condensed milk, also called \\\"Sguschyonka\\\" in Russia, once was a part of field ration for the Union soldiers in Civil War, but later reached unprecedented popularity in post-Soviet countries, becoming almost a staple product. Canned, it can be stored for decades and remain just as sweet, tasty and nutritious.\",\n \"Name\": \"Condensed milk\",\n \"ShortName\": \"Cond. milk\"\n }\n },\n \"5448e8d04bdc2ddf718b4569\": {\n \"item\": {\n \"_id\": \"5448e8d04bdc2ddf718b4569\",\n \"_name\": \"Food\",\n \"_parent\": \"543be6674bdc2df1348b4569\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food\",\n \"ShortName\": \"Item\"\n }\n },\n \"543be6674bdc2df1348b4569\": {\n \"item\": {\n \"_id\": \"543be6674bdc2df1348b4569\",\n \"_name\": \"FoodDrink\",\n \"_parent\": \"54009119af1c881c07000029\"\n },\n \"locale\": {\n \"Description\": \"Item\",\n \"Name\": \"Food and drink\",\n \"ShortName\": \"Item\"\n }\n },\n \"54009119af1c881c07000029\": {\n \"item\": {\n \"_id\": \"54009119af1c881c07000029\",\n \"_name\": \"Item\",\n \"_parent\": \"\"\n },\n \"locale\": \"\"\n }\n}" + } + ] + }, + { + "name": "Search item by ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"5734773724597737fd047c14\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by Name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Lait concentré\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search Milk by internal name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"condensed_milk\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + }, + { + "name": "Search item by ShortName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('Content-Type is application/json', function () {\r", + " pm.expect(pm.response.headers.get('Content-Type')).to.eql('application/json');\r", + "});\r", + "\r", + "pm.test('Access-Control-Allow-Origin is present', function () {\r", + " pm.expect(pm.response.headers.get('Access-Control-Allow-Origin')).to.eql('*');\r", + "});\r", + "\r", + "pm.test('Found one item', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items.length).to.eql(1);\r", + "});\r", + "\r", + "pm.test('Item id is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].item._id).to.eql('5734773724597737fd047c14');\r", + "});\r", + "\r", + "pm.test('Locale is correct', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData.items[0].locale.Name).to.eql('Conserve de lait concentré');\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"query\": \"Lait conc.\",\r\n \"locale\": \"{{LOCALE}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SPT_API}}/api/search", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "search" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "pm.environment.set(\"LOCALE\", \"fr\");" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "RefreshAll", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/refresh", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "refresh" + ] + } + }, + "response": [] + }, + { + "name": "Get all locales", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test('At least one locale is present', function () {\r", + " var jsonData = pm.response.json();\r", + " pm.expect(jsonData).length.greaterThan(0);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SPT_API}}/api/locales/", + "host": [ + "{{SPT_API}}" + ], + "path": [ + "api", + "locales", + "" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "pm.environment.set(\"SPT_API\", \"https://db.sp-tarkov.com\");" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ] +} \ No newline at end of file