{"id":15574557,"url":"https://github.com/matheuscas/bluesoft-cosmos-api","last_synced_at":"2025-03-16T19:20:57.863Z","repository":{"id":71230238,"uuid":"122011426","full_name":"matheuscas/bluesoft-cosmos-api","owner":"matheuscas","description":"Um pacote npm para facilitar o acesso à API da Bluesoft Cosmos","archived":false,"fork":false,"pushed_at":"2018-02-19T03:17:58.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T05:46:31.314Z","etag":null,"topics":["api-client","bluesoft-cosmos","ean13","ncm"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matheuscas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-19T02:37:28.000Z","updated_at":"2024-01-23T22:41:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"63c89428-81c6-4b07-9b4d-de17ad14be3f","html_url":"https://github.com/matheuscas/bluesoft-cosmos-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheuscas%2Fbluesoft-cosmos-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheuscas%2Fbluesoft-cosmos-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheuscas%2Fbluesoft-cosmos-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheuscas%2Fbluesoft-cosmos-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matheuscas","download_url":"https://codeload.github.com/matheuscas/bluesoft-cosmos-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243918629,"owners_count":20368745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","bluesoft-cosmos","ean13","ncm"],"created_at":"2024-10-02T18:18:47.014Z","updated_at":"2025-03-16T19:20:57.841Z","avatar_url":"https://github.com/matheuscas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Um pacote npm para facilitar o acesso à API da Bluesoft Cosmos\n\n## Como instalar\n\n```\nnpm install bluesoft-cosmos-api --save\n```\n\n## Como usar\n\n```javascript\nconst cosmos = require('bluesoft-cosmos-api');\n\n// Consiga seu Token em: https://cosmos.bluesoft.com.br\ncosmos.setToken('SEU_TOKEN');\n\n// Consiga resultados para o produto pelo GTIN/EAN13\ncosmos.gtins('7891910000197').then(res =\u003e {\n    console.log('Result: ',res);\n}).catch(err =\u003e {\n    console.log('Error: ',err);\n});\n\n```\n\nRetorno:\n\n```javascript\nSUCESS:  { \n    status: 200,\n    statusText: 'OK',\n    data:\n    { \n        description: 'AÇÚCAR REFINADO UNIÃO 1KG',\n        gtin: 7891910000197,\n        thumbnail: 'https://cdn-cosmos.bluesoft.com.br/products/7891910000197',\n        price: 'R$ 2,99',\n        avg_price: 2.99,\n        max_price: 2.99,\n        min_price: 2.99,\n        width: null,\n        height: null,\n        length: null,\n        net_weight: 1000,\n        gross_weight: 1000,\n        barcode_image: 'http://api.cosmos.bluesoft.com.br/products/barcode/C5A6D9FADB6D01B6E5B321FAB9053F92.png',\n        brand: { name: 'UNIAO', picture: '' },\n        gpc:{ \n            code: '10000043',\n            description: 'Açúcar / Substitutos do Açúcar (Não perecível)' \n        },\n        ncm:{ \n            code: '17019900',\n            description: 'Outros',\n            full_description: 'Açúcares e produtos de confeitaria - Açúcares de cana ou de beterraba e sacarose quimicamente pura, no estado sólido - Outros: - Outros' \n        },\n        cest:{ \n            id: 2154,\n            code: '1710300',\n            description: 'Outros tipos de açúcar, em embalagens de conteúdo inferior ou igual a 2 kg, exceto as embalagens contendo envelopes individualizados (sachês) de conteúdo inferior ou igual a 10 g',\n            parent_id: 1671 \n        },\n        gtins: [\n            {\"gtin\":7891910000197,\"commercial_unit\":{\"type_packaging\":\"Unidade\",\"quantity_packaging\":1,\"ballast\":null,\"layer\":null}},\n            {\"gtin\":7891910000203,\"commercial_unit\":{\"type_packaging\":\"Fardo\",\"quantity_packaging\":10,\"ballast\":null,\"layer\":null}}\n        ] \n    } \n}\n```\n\nMais funções da API:\n\n```javascript\n/* Recupera detalhes do NCM e Produtos vínculados a ele, atráves do código informado.\n * @param {*} ncm \n * @param {*} page \n */\nfunction ncmsProducts(ncm[, page])\n\nEx.:\n\n// Passando uma página\ncosmos.ncmsProducts('18063110', 2).then(res =\u003e {\n    console.log('SUCESS: ',res);\n}).catch(err =\u003e {\n    console.log('catch: ',err);\n});\n\ncosmos.ncmsProducts('18063110').then(res =\u003e {\n    console.log('SUCESS: ',res);\n}).catch(err =\u003e {\n    console.log('catch: ',err);\n});\n\n```\nDisclaimer: eu não sou funcionário da Bluesoft ou não estou ganhando nada para fazer esse pacote. O \nganho, pessoal, é duplo: aprender a criar e publicar um pacote npm e usar a API da Bluesoft em outro projeto pessoal. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheuscas%2Fbluesoft-cosmos-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatheuscas%2Fbluesoft-cosmos-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheuscas%2Fbluesoft-cosmos-api/lists"}