{"_id":"@caor/iwinv-alimtalk","_rev":"2-c84b6e14b4fe06371e17c3d4c4b52f41","name":"@caor/iwinv-alimtalk","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@caor/iwinv-alimtalk","version":"0.1.0","keywords":["iwinv","alimtalk","cli"],"license":"MIT","_id":"@caor/iwinv-alimtalk@0.1.0","maintainers":[{"name":"garam","email":"garam-park@naver.com"}],"bin":{"iwinv-alimtalk":"dist/src/bin.js"},"dist":{"shasum":"224272d56db3cb3f80cc7e0bc98cbce5cce2ff4a","tarball":"https://registry.npmjs.org/@caor/iwinv-alimtalk/-/iwinv-alimtalk-0.1.0.tgz","fileCount":17,"integrity":"sha512-fBw8dfztB4LcTm2BQs67D3IPNZEbSJBT6HLnadJbZrUBtdGMqaJFY6yyxOjBL5c3fJBsZGImILyUA9vnHkYSRw==","signatures":[{"sig":"MEYCIQCX0KTpIR5uNnDKYvPlApboJDgGUvJwqYz+YWXgu+A+EwIhAOHcxZ3WQRFk+o30RGDcwTuK1rTXow4kgHyk4cJ6SrHL","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34819},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/src/index.d.ts","default":"./dist/src/index.js"}},"gitHead":"7ce986ebf8937713e458a2adc913004f9263096b","scripts":{"lint":"eslint .","test":"npm run build && node --test dist/test/*.test.js","build":"npm run clean && tsc -p tsconfig.json","clean":"rm -rf dist","format":"prettier --write .","prepare":"husky","lint:fix":"eslint . --fix","postbuild":"chmod +x dist/src/bin.js","format:check":"prettier --check .","test:coverage":"npm run build && node --test --experimental-test-coverage --test-coverage-exclude='dist/test/**' --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 dist/test/*.test.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"garam","email":"garam-park@naver.com"},"_npmVersion":"10.9.8","description":"Dependency-free Node 22+ ESM library and CLI for the iwinv Alimtalk API.","directories":{},"lint-staged":{"*.{ts,js,mjs,cjs}":["eslint --fix","prettier --write"],"*.{md,yml,yaml,json}":["prettier --write"]},"_nodeVersion":"22.23.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^9.15.0","prettier":"^3.4.1","typescript":"^5.9.3","@types/node":"^25.9.2","lint-staged":"^15.2.10","@commitlint/cli":"^19.6.0","typescript-eslint":"^8.15.0","eslint-plugin-import":"^2.31.0","@commitlint/config-conventional":"^19.6.0"},"_npmOperationalInternal":{"tmp":"tmp/iwinv-alimtalk_0.1.0_1782734176447_0.13087940141646826","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@caor/iwinv-alimtalk","version":"0.2.2","description":"Dependency-free Node 22+ ESM library and CLI for the iwinv Alimtalk API.","repository":{"type":"git","url":"git+https://github.com/caorteam/iwinv-alimtalk.git"},"homepage":"https://github.com/caorteam/iwinv-alimtalk#readme","bugs":{"url":"https://github.com/caorteam/iwinv-alimtalk/issues"},"type":"module","main":"./dist/src/index.js","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","default":"./dist/src/index.js"}},"bin":{"iwinv-alimtalk":"dist/src/bin.js"},"publishConfig":{"access":"public"},"engines":{"node":">=22"},"scripts":{"clean":"rm -rf dist","build":"npm run clean && tsc -p tsconfig.json","postbuild":"chmod +x dist/src/bin.js","test":"npm run build && node --test dist/test/*.test.js","test:coverage":"npm run build && node --test --experimental-test-coverage --test-coverage-exclude='dist/test/**' --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 dist/test/*.test.js","prepublishOnly":"npm run build","lint":"eslint .","lint:fix":"eslint . --fix","format":"prettier --write .","format:check":"prettier --check .","prepare":"husky"},"lint-staged":{"*.{ts,js,mjs,cjs}":["eslint --fix","prettier --write"],"*.{md,yml,yaml,json}":["prettier --write"]},"keywords":["iwinv","alimtalk","cli"],"license":"MIT","devDependencies":{"@commitlint/cli":"^19.6.0","@commitlint/config-conventional":"^19.6.0","@types/node":"^25.9.2","eslint":"^9.15.0","eslint-plugin-import":"^2.31.0","husky":"^9.1.7","lint-staged":"^15.2.10","prettier":"^3.4.1","typescript":"^5.9.3","typescript-eslint":"^8.15.0"},"gitHead":"d49e4034e4451140c067f360fe491cf8e1e493e3","_id":"@caor/iwinv-alimtalk@0.2.2","_nodeVersion":"22.23.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-qB+5V4UmQZXjQH8W8q+1fJ/a+9urAFgoj+v90BtjlYavEH7CKi2E2fIUuuVhXPNViDBJkihnVN0YSdvGDwXR1g==","shasum":"c158dbab6c582b14487101fd822e6bf2d4796c0b","tarball":"https://registry.npmjs.org/@caor/iwinv-alimtalk/-/iwinv-alimtalk-0.2.2.tgz","fileCount":17,"unpackedSize":35505,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@caor%2fiwinv-alimtalk@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDiAqGM+f64gd2uT/mJQSTtdeN1Xm71W5YsZvLc4k0aPAiAkLlVJsjinCAeo7rYgWdFtM9maMc9JFWdXWPwavCKNdg=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6fe0c75e-4cf2-4995-913e-d26bfbef53b2"}},"directories":{},"maintainers":[{"name":"garam","email":"garam-park@naver.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/iwinv-alimtalk_0.2.2_1782744117096_0.9617104390296742"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-29T11:56:16.271Z","modified":"2026-06-29T14:41:57.660Z","0.1.0":"2026-06-29T11:56:16.610Z","0.2.2":"2026-06-29T14:41:57.239Z"},"license":"MIT","keywords":["iwinv","alimtalk","cli"],"description":"Dependency-free Node 22+ ESM library and CLI for the iwinv Alimtalk API.","maintainers":[{"name":"garam","email":"garam-park@naver.com"}],"readme":"# iwinv Alimtalk CLI\n\nDependency-free Node 22+ ESM library and CLI for the iwinv Alimtalk API.\n\n## Install\n\nRequires Node.js 22 or newer.\n\n### As a CLI\n\n```sh\nnpm install -g @caor/iwinv-alimtalk\niwinv-alimtalk --help\n```\n\nOr run it without installing:\n\n```sh\nnpx @caor/iwinv-alimtalk --help\n```\n\n### As a library\n\n```sh\nnpm install @caor/iwinv-alimtalk\n```\n\n```js\nimport { requestApi, ApiError } from '@caor/iwinv-alimtalk';\n\ntry {\n  const result = await requestApi({\n    command: 'send',\n    apiKey: process.env.IWINV_ALIMTALK_API_KEY,\n    body: { templateCode: '10030', list: [{ phone: '01012341234', templateParam: ['홍길동'] }] }\n  });\n  console.log(result);\n} catch (error) {\n  if (error instanceof ApiError) {\n    console.error(error.status, error.body);\n  }\n}\n```\n\n## Environment Variables\n\n- `IWINV_ALIMTALK_API_KEY`: API key used for the `AUTH` header when `--api-key` is not provided.\n- `IWINV_ALIMTALK_BASE_URL`: Optional base URL override for local mocks or tests. Defaults to `https://alimtalk.bizservice.iwinv.kr`.\n\n`--api-key` takes precedence over `IWINV_ALIMTALK_API_KEY`.\n\nSet `IWINV_ALIMTALK_API_KEY` to the raw API key exactly as issued. Do not pre-encode or hash it. The CLI base64-encodes the raw key internally before sending the `AUTH` header. Base64 is encoding, not hashing, so treat the value as a secret.\n\n## Commands\n\nAll API requests use the iwinv `AUTH` header as `base64_encode(API Key)`. JSON requests use `Content-Type: application/json;charset=UTF-8`.\n\n| Command           | Method | Endpoint                | Body |\n| ----------------- | ------ | ----------------------- | ---- |\n| `send`            | `POST` | `/api/v2/send/`         | JSON |\n| `template list`   | `POST` | `/api/template/`        | JSON |\n| `template add`    | `POST` | `/api/template/add/`    | JSON |\n| `template modify` | `POST` | `/api/template/modify/` | JSON |\n| `template delete` | `POST` | `/api/template/delete/` | JSON |\n| `history`         | `POST` | `/api/history/`         | JSON |\n| `cancel`          | `POST` | `/api/cancel/`          | JSON |\n| `charge`          | `GET`  | `/api/charge/`          | none |\n\n## JSON Body Input\n\nCommands that need a request body accept JSON from exactly one source: `--json`, `--file`, or stdin. The CLI passes the JSON object through unchanged.\n\n### Inline JSON\n\n```sh\niwinv-alimtalk send \\\n  --api-key \"$IWINV_ALIMTALK_API_KEY\" \\\n  --json '{\"templateCode\":\"10030\",\"list\":[{\"phone\":\"01012341234\",\"templateParam\":[\"홍길동\"]}]}'\n```\n\n### File JSON\n\n```sh\niwinv-alimtalk template add --file template-add.json --pretty\n```\n\nExample `template-add.json`:\n\n```json\n{\n  \"templateName\": \"템플릿명\",\n  \"templateContent\": \"안녕하세요 #{name}님\",\n  \"buttons\": [\n    {\n      \"type\": \"WL\",\n      \"name\": \"웹링크\",\n      \"linkPc\": \"https://www.iwinv.kr/\",\n      \"linkMo\": \"https://www.iwinv.kr/\"\n    }\n  ]\n}\n```\n\n### Stdin JSON\n\n```sh\nprintf '{\"pageNum\":\"1\",\"pageSize\":\"10\"}' | iwinv-alimtalk template list --pretty\n```\n\n## Examples\n\n```sh\niwinv-alimtalk charge --pretty\n```\n\n```sh\niwinv-alimtalk template list --json '{\"pageNum\":\"1\",\"pageSize\":\"10\"}' --pretty\n```\n\n```sh\niwinv-alimtalk template modify --file template-modify.json\n```\n\n```sh\niwinv-alimtalk template delete --json '{\"templateCode\":\"10030\"}'\n```\n\n```sh\niwinv-alimtalk history --json '{\"pageNum\":\"1\",\"pageSize\":\"10\",\"startDate\":\"2021-06-07\"}' --pretty\n```\n\n```sh\niwinv-alimtalk cancel --json '{\"seqNo\":\"11\"}'\n```\n\n## Dry Run\n\n`--dry-run` prints the method, URL, redacted `AUTH` header, content type, and request body without making a network call. It does not require a real API key.\n\n```sh\niwinv-alimtalk send \\\n  --json '{\"templateCode\":\"10030\",\"list\":[]}' \\\n  --dry-run \\\n  --pretty\n```\n\nDry-run output redacts the base64 `AUTH` value and never prints the raw API key.\n\n## Live API Safety\n\nTests and smoke checks should use injected or mocked `fetch` and must not call the real iwinv API. For manual experiments, use `--dry-run` first or set `IWINV_ALIMTALK_BASE_URL` to a local mock server. Only remove `--dry-run` when you intentionally want to send a live API request.\n\n## Development\n\nThe source is strict TypeScript under `src/` and tests are TypeScript under `test/`. Build output is emitted to `dist/`; the CLI entry point is `dist/src/bin.js` and the library entry point is `dist/src/index.js`.\n\nTo build and run from source:\n\n```sh\nnpm install\nnpm run build\nnode ./dist/src/bin.js --help\n```\n\n```sh\nnpm test\n```\n\n```sh\nnpm run test:coverage\n```\n\n`npm test` runs the TypeScript build first, then executes the compiled tests from `dist/test`. `npm run test:coverage` additionally enforces 100% line, branch, and function coverage on `src/` (requires Node 22.8+). The package has no runtime dependencies and uses Node's built-in `node:test`, `assert`, `fetch`, and `Buffer` APIs.\n\n## Release & Publishing\n\nReleases are automated via [release-please](https://github.com/googleapis/release-please) on `main`. Conventional Commits drive version bumps and CHANGELOG generation; merging the resulting release PR triggers `.github/workflows/publish.yml`, which publishes to npm with provenance using [Trusted Publishing](https://docs.npmjs.com/generating-provenance-statements) (OIDC) — no long-lived token required.\n","readmeFilename":"README.md","homepage":"https://github.com/caorteam/iwinv-alimtalk#readme","repository":{"type":"git","url":"git+https://github.com/caorteam/iwinv-alimtalk.git"},"bugs":{"url":"https://github.com/caorteam/iwinv-alimtalk/issues"}}