npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@montarist/tamamliyo-api

v0.1.9

Published

Unofficial TypeScript SDK for Tamamliyo partner APIs.

Downloads

24

Readme

Unofficial Tamamliyo API

TypeScript SDK for the Tamamliyo partner APIs. It wraps the public insurance endpoints into a typed, enum-driven client with built-in retries, request validation, and response parsing.

Features

  • Automatic token header injection and configurable base URL/environment.
  • Resilient HTTP layer with retries, timeouts, and backoff.
  • Zod-based request/response validation covering Incoming Insurance, Foreign Health Insurance, and Transportation Insurance flows.
  • Enumerations for common query modes (QueryType) and reusable schemas for geography lookups.
  • Vitest + MSW test suite with coverage reporting.
  • Ready-to-run examples and docs-driven API design (docs/*.md).

Installation

pnpm add @montarist/tamamliyo-api
# or
npm install @montarist/tamamliyo-api

Quick Start

import { ApiEnvironment, Client, QueryType } from '@montarist/tamamliyo-api';

const client = new Client({
  token: process.env.TAMAMLIYO_TOKEN!,
  environment: ApiEnvironment.Test, // defaults to production base URL
});

const quote = await client.incomingInsurance.createQuote({
  sorguTipi: QueryType.Passport,
  sigortaEttiren: {
    pasaportNo: 'X1234567',
    ad: 'Ada',
    soyad: 'Yilmaz',
    cinsiyet: 'K',
    uyruk: '33',
    babaAdi: 'Mehmet',
    dogumYeri: 'Paris',
    dogumTarihi: '1998-12-31',
  },
  sigortali: [
    {
      pasaportNo: 'X1234567',
      ad: 'Ada',
      soyad: 'Yilmaz',
      cinsiyet: 'K',
      uyruk: '33',
      babaAdi: 'Mehmet',
      dogumYeri: 'Paris',
      dogumTarihi: '1998-12-31',
      relationTypeId: 'F',
    },
  ],
  baslangicTarihi: '2024-05-01',
  bitisTarihi: '2024-05-15',
  email: '[email protected]',
  gsmNo: '5551234567',
  urunId: 110,
});

console.log(quote.data.teklifBilgileri.teklifId);

API Surface

Incoming Insurance

  • createQuote
  • makePayment
  • createPolicy
  • getQuoteDetails
  • listCountries
  • listProvinces
  • listDistricts
  • getPolicyPdf
  • getReceiptPdf

Green Card Insurance

  • getPrice
  • createQuote
  • makePayment
  • createPolicy
  • getPolicyPdf
  • getCertificatePdf
  • getReceiptPdf

Foreign Health Insurance

  • getPrice
  • createQuote
  • makePayment
  • createPolicy
  • getQuoteDetails
  • listProducts
  • Geography + PDF helpers

Travel Health Insurance

  • listProductCodes
  • getPrice
  • createQuote
  • makePayment
  • createPolicy
  • getQuoteDetails
  • listCountries
  • listProvinces
  • listDistricts
  • getPolicyPdf
  • getReceiptPdf
  • Fast Track helpers (createFastTrackQuote, createFastTrackSale, confirmFastTrackPayment, listFastTrackPrices, listFastTrackAirports)

Transportation Insurance

  • createRequest

Roadside Assistance

  • createOrder
  • getOrder
  • downloadCertificate
  • Reference data lookups (listProducts, listVehicleBrands, listVehicleModels, listVehicleYears, listCities, listTowns)

DASK Insurance

  • createQuote
  • makePayment
  • createPolicy
  • getPolicyPdf
  • getReceiptPdf
  • getQuoteDetails
  • Property reference helpers (damage type, construction year, usage type, banks, UAVT hierarchy)

Traffic & Casco Requests

  • createRequest

Configuration

const client = new Client({
  token: 'partner-token',
  environment: ApiEnvironment.Production,
  timeoutMs: 20_000,
  maxRetries: 2,
  concurrency: 4,
  userAgent: 'tamamliyo-sdk/0.1.0',
});

environment chooses between https://api.tamamliyo.com and https://api-test.tamamliyo.com. You can override baseUrl directly for custom deployments.

Development

pnpm install
pnpm lint
pnpm test
pnpm build
pnpm test:e2e # requires environment variables (see below)
  • Tests run via Vitest with MSW-powered mocks (pnpm test).
  • Coverage reports appear under coverage/.
  • Example scripts live under examples/.
  • End-to-end tests hit the real Tamamliyo APIs when pnpm test:e2e runs. Configure credentials in .env.development (added to .gitignore).

E2E Environment Variables

Copy .env.development.example to .env.development (never commit) and fill in at least:

TAMAMLIYO_TOKEN=your_partner_token
# Optional overrides
TAMAMLIYO_BASE_URL=https://api-test.tamamliyo.com
TAMAMLIYO_E2E_TIMEOUT=30000
TAMAMLIYO_E2E_MAX_RETRIES=1
TAMAMLIYO_E2E_DEBUG=false

# Set to true to enable mutating tests (quote/order creation)
TAMAMLIYO_E2E_MUTATIONS=false

# Provide JSON payloads for mutating flows when enabling mutations
# Example:
# TAMAMLIYO_INCOMING_QUOTE_PAYLOAD={"sorguTipi":2,"sigortaEttiren":{...}}
# TAMAMLIYO_FOREIGN_QUOTE_PAYLOAD={...}
# TAMAMLIYO_TRAVEL_QUOTE_PAYLOAD={...}
# TAMAMLIYO_TRAVEL_FAST_TRACK_QUOTE_PAYLOAD={...}
# TAMAMLIYO_TRAVEL_FAST_TRACK_CONFIRM_PAYLOAD={...}
# TAMAMLIYO_GREEN_CARD_QUOTE_PAYLOAD={...}
# TAMAMLIYO_DASK_QUOTE_PAYLOAD={...}
# TAMAMLIYO_ROADSIDE_ORDER_PAYLOAD={...}
# TAMAMLIYO_TRANSPORTATION_REQUEST_PAYLOAD={...}
# TAMAMLIYO_TRAFFIC_REQUEST_PAYLOAD={...}
# TAMAMLIYO_GREEN_CARD_PRICE_PAYLOAD={"urunId":176}

Tip: Export JSON payloads carefully—they should mirror the official specs. The e2e suite skips mutating tests unless TAMAMLIYO_E2E_MUTATIONS=true and the corresponding payload env exists.

Documentation Sources

Implementation follows the markdown specs under docs/ (e.g., docs/01-incoming-insurances.md). Add new docs there and extend the SDK accordingly.

License

MIT