{"_id":"@afilimax/shopee-provider","name":"@afilimax/shopee-provider","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@afilimax/shopee-provider","version":"0.1.0","description":"Provedor de links de afiliados para a Shopee, integrado ao ecossistema Afilimax.","type":"commonjs","repository":{"type":"git","url":"git+https://github.com/Afilimax/shopee-provider.git"},"homepage":"https://github.com/Afilimax/shopee-provider#readme","bugs":{"url":"https://github.com/Afilimax/shopee-provider/issues"},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","dev":"ts-node ./src/index.ts","format":"prettier --write \"src/**/*.ts\"","lint":"eslint \"src/**/*.ts\" --fix","test":"vitest","test:cov":"vitest run --coverage"},"publishConfig":{"access":"public"},"keywords":["afilimax","shopee","affiliate","provider"],"author":{"name":"Marcuth"},"license":"MIT","devDependencies":{"@afilimax/core":"^0.4.1","@types/node":"^25.5.0","@vitest/coverage-v8":"^4.1.0","eslint":"^10.0.3","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","eslint-plugin-unused-imports":"^4.4.1","prettier":"^3.8.1","prettier-plugin-sort-imports":"^1.8.11","ts-node":"^10.9.2","typescript":"^5.9.3","vitest":"^4.1.0"},"gitHead":"c4dcd371d8f205011ef3c5b9c85cd0af5138cf57","_id":"@afilimax/shopee-provider@0.1.0","_nodeVersion":"24.13.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-1rOJuDTZzgBRpCVfy0QEjnlHuTyTK+yjAkwkFmaLzFfIsmH9QQU6ebBs7lvQ05hoy1eLtDAOFleBrEF8EZDI/g==","shasum":"dded911d1b7c9e9ce1a0ae1b9f94c195b66fdce0","tarball":"https://registry.npmjs.org/@afilimax/shopee-provider/-/shopee-provider-0.1.0.tgz","fileCount":5,"unpackedSize":7349,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAW12xz9IF+DTJOpypRDhb1Bcp5v+tBY3rDIzSZhLW+xAiAJ5OjifUyv85qv3NBI+Ce7F7f25Qo+/+SeaOOWz8+eKQ=="}]},"_npmUser":{"name":"marcuth","email":"marcuth2006@gmail.com"},"directories":{},"maintainers":[{"name":"marcuth","email":"marcuth2006@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/shopee-provider_0.1.0_1773553465496_0.5462063949170239"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-15T05:44:25.414Z","0.1.0":"2026-03-15T05:44:25.651Z","modified":"2026-03-15T05:44:25.852Z"},"maintainers":[{"name":"marcuth","email":"marcuth2006@gmail.com"}],"description":"Provedor de links de afiliados para a Shopee, integrado ao ecossistema Afilimax.","homepage":"https://github.com/Afilimax/shopee-provider#readme","keywords":["afilimax","shopee","affiliate","provider"],"repository":{"type":"git","url":"git+https://github.com/Afilimax/shopee-provider.git"},"author":{"name":"Marcuth"},"bugs":{"url":"https://github.com/Afilimax/shopee-provider/issues"},"license":"MIT","readme":"# @afilimax/shopee-provider\n\nProvedor de links de afiliados para a Shopee, integrado ao ecossistema Afilimax. Este pacote permite converter URLs de produtos da Shopee em links de afiliados encurtados utilizando a API oficial de parcerias da Shopee.\n\n## Instalação\n\n```bash\nnpm install @afilimax/shopee-provider\n```\n\n> [!IMPORTANT]\n> Este pacote requer `@afilimax/core` como dependência de par (peer dependency).\n\n## Como usar\n\nO `ShopeeProvider` utiliza autenticação baseada em `appId` e `appSecret` fornecidos pelo portal de afiliados da Shopee.\n\n```typescript\nimport { ShopeeProvider } from \"@afilimax/shopee-provider\";\n\nconst provider = new ShopeeProvider({\n    appId: \"seu_app_id\",\n    appSecret: \"seu_app_secret\",\n    subIds: [\"seu_sub_id_opcional\"]\n});\n\nasync function run() {\n    const originalUrl = \"https://shopee.com.br/produto-exemplo-i.123456.7891011\";\n    \n    try {\n        const affiliateUrl = await provider.createAffiliateUrl(originalUrl);\n        console.log(\"Link de Afiliado:\", affiliateUrl); // Retorna o link encurtado (Ex: https://shpe.ee/...)\n    } catch (error) {\n        console.error(\"Erro ao gerar link:\", error.message);\n    }\n}\n\nrun();\n```\n\n## Configurações\n\nA interface `ShopeeProviderOptions` aceita as seguintes propriedades:\n\n| Propriedade | Tipo | Descrição |\n| :--- | :--- | :--- |\n| `appId` | `string` | Seu App ID obtido no portal de Afiliados da Shopee. |\n| `appSecret` | `string` | Sua App Secret correspondente para assinatura de requisições. |\n| `subIds` | `string[]` | (Opcional) Sub IDs para rastreamento interno (máximo de 5). |\n\n## Domínios Suportados\n\nO provedor identifica automaticamente URLs dos seguintes domínios:\n- `shopee.com.br`\n- `shopee.com`\n- `sho.pe`\n- `shp.ee`\n\n## Desenvolvimento\n\n### Scripts Disponíveis\n\n- `npm run build`: Compila o projeto para o diretório `dist`.\n- `npm run dev`: Executa o projeto em ambiente de desenvolvimento usando `ts-node`.\n- `npm run test`: Executa os testes unitários com Vitest.\n- `npm run lint`: Verifica e corrige problemas de estilo de código.\n- `npm run format`: Formata o código fonte usando Prettier.\n\n---\n\nProduzido com ❤️ pela equipe **Afilimax**.","readmeFilename":"README.md","_rev":"1-7c0f456de49d19554b31e1a8ca012b00"}